I declare dictionary as following:
private Dictionary<int, touchInformation> touchDictionary = new Dictionary<int, touchInformation>();
And I used as following:
touchDictionary[touchID]
= touchObject;
So, the touchDictionary will keep the key from touchID. Now, I try to find the minimum key using dictionary but I don't know how to do. Have any suggestion?
Regard, C.Porawat
Dictionary has a Keys property which allows you to enumerate the keys within the dictionary. You can use the Min Linq extension methods to get the minimum key as follows:
int minimumKey = touchDictionary.Keys.Min();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With