Ejemplo n.º 1
0
 public void RemoveWatch(WatchDetails watch)
 {
     mWatches.Remove(watch.ID);
     if (mConnectedTarget != null && watch.Enabled)
     {
         watch.State = WatchState.PendingRemove;
         mConnectedTarget.RemoveWatch(watch.ID);
     }
 }
Ejemplo n.º 2
0
        private void DeleteWatch(TreeTableNode node)
        {
            VariableDetails varInfo = (VariableDetails)node.Tag;
            WatchDetails    watch   = mDebugger.FindWatch(varInfo.WatchID);

            if (watch != null)
            {
                mDebugger.RemoveWatch(watch);
            }
            node.Parent.Items.Remove(node);
        }
Ejemplo n.º 3
0
        public WatchDetails AddWatch(string expr)
        {
            WatchDetails watch = new WatchDetails(expr, true);

            mWatches.Add(watch.ID, watch);

            if (mConnectedTarget != null)
            {
                watch.State = WatchState.PendingAdd;
                mConnectedTarget.AddWatch(watch.Expression, watch.ID);
            }

            return(watch);
        }
Ejemplo n.º 4
0
        private TreeTableNode AddWatch(string expression, int index)
        {
            WatchDetails  watch = mDebugger.AddWatch(expression);
            TreeTableNode node  = AddVariable(new VariableDetails(watch.ID, new LuaValue[] { }, null, null, false, false, false, false, VariableClass.Watch));

            node.Font = mBoldFont;
            if (index < 0)
            {
                variablesListView.Root.Items.Add(node);
            }
            else
            {
                variablesListView.Root.Items.Insert(index, node);
            }
            node.Text = expression;
            return(node);
        }
Ejemplo n.º 5
0
		public void RemoveWatch(WatchDetails watch)
		{
			mWatches.Remove(watch.ID);
			if(mConnectedTarget != null && watch.Enabled)
			{
				watch.State = WatchState.PendingRemove;
				mConnectedTarget.RemoveWatch(watch.ID);
			}
		}
Ejemplo n.º 6
0
		public WatchDetails AddWatch(string expr)
		{
			WatchDetails watch = new WatchDetails(expr, true);
			mWatches.Add(watch.ID, watch);

			if (mConnectedTarget != null)
			{
				watch.State = WatchState.PendingAdd;
				mConnectedTarget.AddWatch(watch.Expression, watch.ID);
			}

			return watch;
		}
Ejemplo n.º 7
0
        private void variablesListView_AfterLabelEdit(object sender, LabelEditEventArgs e)
        {
            m_editInProgress         = false;
            contextMenuStrip.Enabled = true;
            toolStrip1.Enabled       = true;

            TreeTableNode node = variablesListView.Nodes[e.Item];

            string expression = e.Label == null ? "" : e.Label.Trim();

            variablesListView.BeginUpdate();

            // Did the user cancel adding a new watch?
            if (node.Text == "" && expression == "")
            {
                e.CancelEdit = true;
                node.Parent.Items.Remove(node);
            }

            // Did the user cancel the change?
            else if (e.Label == null || expression == node.Text)
            {
                // Do nothing
            }

            // Did the user delete an existing watch?
            else if (expression == "")
            {
                e.CancelEdit = true;
                DeleteWatch(node);
            }

            // The user modified an existing watch
            else
            {
                VariableDetails oldVar = node.Tag as VariableDetails;
                if (oldVar != null)
                {
                    WatchDetails oldWatch = mDebugger.FindWatch(oldVar.WatchID);
                    if (oldWatch != null)
                    {
                        mDebugger.RemoveWatch(oldWatch);
                    }
                }

                WatchDetails    newWatch = mDebugger.AddWatch(expression);
                VariableDetails newVar   = new VariableDetails(newWatch.ID, new LuaValue[] { }, null, null, false, false, false, false, VariableClass.Watch);
                node.Tag              = newVar;
                node.Key              = newVar.ToString();
                node.Text             = expression;
                node.SubItems[1].Text = "";
                node.SubItems[2].Text = "";

                if (mDebugger.ConnectedTarget != null && mDebugger.CurrentStackFrame != null)
                {
                    mDebugger.ConnectedTarget.RetrieveWatches(mDebugger.CurrentThread, mDebugger.CurrentStackFrame.Depth);
                }
            }

            variablesListView.EndUpdate();
        }