Пример #1
0
 /// <summary> Initalizes a new instance. </summary>
 public WebTreeNode(string itemID, string text, string toolTip, IconInfo icon)
 {
     ValidateItemId(itemID);
     _itemID   = itemID;
     _text     = text ?? string.Empty;
     _toolTip  = toolTip ?? string.Empty;
     _icon     = icon;
     _children = new WebTreeNodeCollection(null);
     _children.SetParent(null, this);
 }
Пример #2
0
 private void ValidateItemId(string value)
 {
     ArgumentUtility.CheckNotNullOrEmpty("value", value);
     if (!string.IsNullOrEmpty(value))
     {
         WebTreeNodeCollection nodes = null;
         if (ParentNode != null)
         {
             nodes = ParentNode.Children;
         }
         else if (TreeView != null)
         {
             nodes = TreeView.Nodes;
         }
         if (nodes != null)
         {
             if (nodes.Find(value) != null)
             {
                 throw new ArgumentException("The collection already contains a node with ItemID '" + value + "'.", "value");
             }
         }
     }
 }
Пример #3
0
 public WebTreeNode()
 {
     _children = new WebTreeNodeCollection(null);
     _children.SetParent(null, this);
 }