FreakBoy
Member
I apologize if this has shown up before, I searched and could not find the correct thread... if it has been brought up I'd be happy to have a link to the relevant thread.
I am attempting to create a class which holds a Key/Value pair like a dictionary object but is limited to one pair.
The Key would always be of type String, while the Value could be of any type needed without using type Object.
The individual instances of this class are to be added to a strongly typed dictionary based collection.
"Thing" being the class with the single Key/Value pair
"Things" being the strongly type diction of type Thing
I realize that it is possible I am over-thinking this, though in all of the projects I have created to help me learn more I keep running in to this same problem and haven't been able to come up with a solution.
Any help at is appreciated.
I am attempting to create a class which holds a Key/Value pair like a dictionary object but is limited to one pair.
The Key would always be of type String, while the Value could be of any type needed without using type Object.
The individual instances of this class are to be added to a strongly typed dictionary based collection.
"Thing" being the class with the single Key/Value pair
"Things" being the strongly type diction of type Thing
VB.NET:
Dim x1 as Thing
Dim x2 as Thing
Dim x3 as Thing
Dim xs as New Things
x1.Name = "x1Name"
x2.Name = "x2Name"
x3.Name = "x3Name"
x1.Value = 5
x2.Value = 5.3
x3.Value = "Five"
xs.add(x1)
xs.add(x2)
xs.add(x3)
I realize that it is possible I am over-thinking this, though in all of the projects I have created to help me learn more I keep running in to this same problem and haven't been able to come up with a solution.
Any help at is appreciated.