コード例 #1
0
        /// <summary>
        /// Clone a Node
        /// </summary>
        /// <returns></returns>
        public new TreeNodeItemSelector Clone()
        {
            TreeNodeItemSelector n = new TreeNodeItemSelector(Text, Value, _checkState, NodeType);

            n.NodeFont = NodeFont;

            if (GetNodeCount(false) > 0)
            {
                foreach (TreeNodeItemSelector child in Nodes)
                {
                    n.AddChild(child.Clone());
                }
            }

            return(n);
        }
コード例 #2
0
        /// <summary>
        /// Create a child Node
        /// </summary>
        /// <param name="text"></param>
        /// <param name="value"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public TreeNodeItemSelector CreateChildNode(string text, object value, CheckState state)
        {
            TreeNodeItemSelector n = null;

            //specific method for datetimenode
            if (NodeType == CustomNodeType.DateTimeNode)
            {
                n = new TreeNodeItemSelector(text, value, state, CustomNodeType.DateTimeNode);
            }

            if (n != null)
            {
                AddChild(n);
            }

            return(n);
        }
コード例 #3
0
 /// <summary>
 /// Add a child Node to this Node
 /// </summary>
 /// <param name="child"></param>
 protected void AddChild(TreeNodeItemSelector child)
 {
     child.Parent = this;
     Nodes.Add(child);
 }