vendredi 23 octobre 2015

C#: Attribute on collection element

In C# can attribute be applied to element, which will be packed in collection? I have Dictionary<string,Func<int,int,int>> and add elements in that way

Dictionary<string,Func<int,int,int>> dict = new Dictionary<string,Func<int,int,int>>();

dict.Add("SUM", (a,b) => {return a+b;});

So I want add additional information to element with key "SUM" such as "Returns summary of two numbers". Can this be done with attributes or I must include additional data in collection?





Aucun commentaire:

Enregistrer un commentaire