c# - Using a combination of two fields as key in a dictionary -
i need store c# dict can store members based on intptr , enum (castable int if helps). in other words, if same match of intptr , enum (named sp_playlist_type) need able same result out, (that's important). i've figured i'd make struct containing two, , override gethashcode(), i'd need hashing-algorithm doesn't create duplicates 2 numbers, , generates same result every time same 2 numbers present.
i think based on way tuple's gethashcode , equality alredy created, have:
dictionary<tuple<intptr, yourenum>, yourresulttype>
provided on .net 4.0 of course.
Comments
Post a Comment