Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store delegates in a List

How can I store delegates (named, anonymous, lambda) in a generic list? Basically I am trying to build a delegate dictionary from where I can access a stored delegate using a key and execute it and return the value on demand. Is it possible to do in C# 4? Any idea to accomplish it? Note : Heterogeneous list is preferable where I can store any kind of delegates.

like image 513
Anindya Chatterjee Avatar asked Sep 28 '10 13:09

Anindya Chatterjee


1 Answers

Does System.Collections.Generic.Dictionary<string, System.Delegate> not suffice?

like image 81
Pete Avatar answered Oct 02 '22 16:10

Pete