Exemple #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);
        }
Exemple #2
0
        private void item_13_Click(object sender, System.EventArgs e)
        {
            FindDialog dlg = new FindDialog(_find);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                _find      = dlg.Find;
                _find.Node = ((AsmView)ActiveMdiChild).SelectedNode;
                ((AsmView)ActiveMdiChild).Find(_find);
            }
        }
Exemple #3
0
        internal void Find(FindState f)
        {
            BaseNode bn = null;

            if (tvAsm.Nodes[0] == null)
            {
                return;
            }

            //try and get successor of node given in f
            if ((f.StartAtRoot == false) && (f.Node != null) && (f.Node.TreeView == tvAsm))
            {
                bn = GetSuccessorNode(f.Node, f);
            }

            //...or else just use root
            if (bn == null)
            {
                bn = (BaseNode)tvAsm.Nodes[0];
            }

            //...iterate thru nodez.
            while (bn != null)
            {
                if (f.Match(bn))
                {
                    break;
                }

                bn = GetSuccessorNode(bn, f);                //we don't descend because RecFind descends
            }


            if (bn != null)
            {
                f.Node             = bn;
                tvAsm.SelectedNode = bn;
                bn.EnsureVisible();
            }
            else
            {
                MessageBox.Show("Cannot Locate Find Criteria");
            }
        }
Exemple #4
0
		private void item_13_Click(object sender, System.EventArgs e)
		{
			FindDialog dlg = new FindDialog(_find);

			if (dlg.ShowDialog() == DialogResult.OK)
			{
				_find = dlg.Find;
				_find.Node = ((AsmView)ActiveMdiChild).SelectedNode;
				((AsmView)ActiveMdiChild).Find(_find);
			}
		}
Exemple #5
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;

		}
Exemple #6
0
		internal void Find(FindState  f)
		{
			BaseNode bn = null;

			if (tvAsm.Nodes[0] == null)
				return;

			//try and get successor of node given in f
			if ((f.StartAtRoot == false) && (f.Node != null) && (f.Node.TreeView == tvAsm))
			{
				bn = GetSuccessorNode(f.Node, f);
			}

			//...or else just use root
			if (bn == null)
			{
				bn = (BaseNode)tvAsm.Nodes[0];
			}

			//...iterate thru nodez.
			while(bn != null)
			{
				if(f.Match(bn))
					break;

				bn = GetSuccessorNode(bn, f);//we don't descend because RecFind descends
			}

			
			if (bn != null)
			{
				f.Node = bn;
				tvAsm.SelectedNode = bn;
				bn.EnsureVisible();
			}
			else
			{
				MessageBox.Show("Cannot Locate Find Criteria");
			}
		}
		public FindDialog(FindState f)
		{
			InitializeComponent();

			Find = f;	
		}
Exemple #8
0
        public FindDialog(FindState f)
        {
            InitializeComponent();

            Find = f;
        }