c# - Sorting IDictionary Generic -
i need know if there way of ordering idictionary without knowing type ...
for example, have method received object , within have dictionary object ... know is dictionary can this:
public void mymethod(propertyinfo propriedadeparametro, object parameters){ idictionary dictionary = ((idictionary) propriedadeparametro.getvalue (parameters, null)); }
but need sort items of dictionary enumpersonalizado regardless of other type "something?" has
idictionary ienumerable, can seek new arraylist(dictionary).sort()
, seek cast members icomparable, or can utilize sort overload accepts icomparer object. way utilize reflection - first find actual keys/values types , create phone call generic orderby.
c# idictionary
No comments:
Post a Comment