Hashtable with MultiDimensional Key in C#

后端 未结 16 1490
闹比i
闹比i 2020-11-27 02:58

I\'m basically looking for a way to access a hashtable value using a two-dimensional typed key in c#.

Eventually I would be able to do something like this



        
16条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 03:44

    Wrap your two-dimensional key in a separate type and use that type as a key. Also consider overriding GetHashCode() and Equals() methods. Preferably use Dictionary<> instead of HashTable since apparently you can use that.

提交回复
热议问题