示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseTreeNodeControl{T}"/> class. It is specialized <see cref="System.Windows.Forms.TreeNode"/>
 /// dedicated to represent all items of the model represented as a tree node.
 /// </summary>
 /// <param name="model">The model entity to be represented an the tree node.</param>
 public BaseTreeNodeControl(TModel model) : base()
 {
     ModelEntity           = model;
     Name                  = model.Text;
     Text                  = model.Text;
     ToolTipText           = model.ToolTipText;
     ImageIndex            = ImagesForNodes.SetIconIndexForNodeAndSelectedNode(ModelEntity.GetType().Name, false);
     SelectedImageIndex    = ImagesForNodes.SetIconIndexForNodeAndSelectedNode(ModelEntity.GetType().Name, true);
     model.TextChanged    += new EventHandler <BaseTreeNode.TextEventArgs>(OnTextChanged);
     model.SubtreeChanged += new EventHandler <BaseTreeNode.ProjectEventArgs>(OnSubtreeChanged);
     AddChildren();
 }