c# store function in list or call function by name
Posted on 2013-05-18
I have a list box and when I click on it, I fire off a function corresponding to that item.
so if I click "Order History" then function OrderHistory is called. I do this by adding strings to the listbox, then having a case statement and test the string and call a function. I'd rather add a string and a function to some list and call it a better way. It would save me typing
functions.add("Order History", OrderHistory());
functions...somehow call that function
This is basically a cheap rip off of a command pattern that I used. this is just for one testing form and i want it to be easy.