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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -