I would like to map a string to a Property using the Dictionary class. For example, I want to map "port" to a textbox's Text property, e.g. myDict.Add(tbPort.Text, "port"). How would I go about defining the dictionary? I've tried the following:
- Private myDict As Dictionary(Of Property, String)
- Private myDict As Dictionary(Of [Property], String)
but these do not work, since Property is not a type.
Is this even possible? If so, how do I define the dictionary? If not, would I have to go about using reflection?