예제 #1
0
        internal BaseNode GetSuccessorNode(BaseNode bn, FindState f)
        {
            BaseNode succ = bn;

            //maybe, check to find a child 'successor'
            if (f.NeedToExpandNode(bn))
            {
                bn.GenerateChildren();
                if (bn.Nodes.Count != 0)
                {
                    return((BaseNode)bn.Nodes[0]);
                }
            }

            //make sure there is a sib, going up tree if necessary
            while (succ.NextNode == null)
            {
                //give up if we reach top.
                if (succ.Parent == null)
                {
                    return(null);
                }

                succ = (BaseNode)succ.Parent;
            }

            succ = (BaseNode)succ.NextNode;

            return(succ);
        }
예제 #2
0
        private void BeforeExpand(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
        {
            BaseNode an = (BaseNode)e.Node;

            if (an.Spinster)
            {
                an.GenerateChildren();
            }
        }
예제 #3
0
		internal BaseNode GetSuccessorNode(BaseNode bn, FindState f)
		{
			BaseNode succ = bn;

			//maybe, check to find a child 'successor'
			if (f.NeedToExpandNode(bn))
			{
				bn.GenerateChildren();
				if (bn.Nodes.Count != 0)
				{
					return (BaseNode)bn.Nodes[0];
				}
			}

			//make sure there is a sib, going up tree if necessary
			while(succ.NextNode == null)
			{
				//give up if we reach top.
				if (succ.Parent == null)
					return null;

				succ = (BaseNode)succ.Parent;
			}

			succ = (BaseNode)succ.NextNode;
			
			return succ;

		}