Beispiel #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);
 }
Beispiel #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");
             }
         }
     }
 }
Beispiel #3
0
 public WebTreeNode()
 {
     _children = new WebTreeNodeCollection(null);
     _children.SetParent(null, this);
 }