c# - How to find minimum key in dictionary -
i declare dictionary following:
private dictionary<int, touchinformation> touchdictionary = new dictionary<int, touchinformation>();
and used following:
touchdictionary[touchid]
= touchobject;
so, touchdictionary keep key touchid. now, try find minimum key using dictionary don't know how do. have suggestion?
regard, c.porawat
dictionary has keys property allows enumerate keys within dictionary. can use min linq extension methods minimum key follows:
int minimumkey = touchdictionary.keys.min();
Comments
Post a Comment