Extension properties

HI, I am creating one custom control in a Windows application that contains a Treeview with n nodes
NUmbe nodes will be resolved at Runtime.
I want to store some data on each TreeNode that I can get when the TreeNode is selected.
The problem is that some node will store custid, custname ..
some store is studid, studname ,,,

I used extension methods
Static class extension
  {
      static dictionary m_Dictionary = new dictionary ();
      public static void SetTags (this TreeNode p_TreeNode, p_Dictionary)
      {
          m_Dictionary = p_Dictionary;
      }
      public static dictionary GetTags (this TreeNode is p_TreeNode)
      {
          return m_Dictionary;
      }
  }
but it doesn't help because I only get data on the last node ...
how can I achieve this.
is there something like ether properties .... or is there any other solution.
Thank In Advance ,,,,

0


a source to share


2 answers


There is nothing called ether properties, if you want to add simple string data to tree nodes use property Tag

.



+1


a source


No, there is no such thing as C # 3.0.



Have a look at this: https://stackoverflow.com/questions/138367/most-wanted-feature-for-c-4-0

0


a source







All Articles