R
Roman
I am using a hastable to associate a TreeNode with a
command object.
hashtable[treeNode] = command;
The problem is that the 'Text' property of the tree node
can change. The hash association will be lost if it does.
For example;
TreeNode treeNode = new TreeNode();
treeNode.Text = "Text1";
hashtable[treeNode] = command;
treeNode.Text = "Text2";
command = hashtable[treeNode];
The last statement returns null since the text property
changed.
What is the best way to make this association independent
of the object's state?
command object.
hashtable[treeNode] = command;
The problem is that the 'Text' property of the tree node
can change. The hash association will be lost if it does.
For example;
TreeNode treeNode = new TreeNode();
treeNode.Text = "Text1";
hashtable[treeNode] = command;
treeNode.Text = "Text2";
command = hashtable[treeNode];
The last statement returns null since the text property
changed.
What is the best way to make this association independent
of the object's state?