Пример #1
0
        void program_InstructionComplete(object sender, Instruction_EventArgs e)
        {
            if (!this.debugEnabledCheckbox.Checked)
            {
                return;
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new EventHandler <Instruction_EventArgs>(this.program_InstructionComplete), sender, e);
            }
            else
            {
                if (this.callStackListBox.Items.Count != this.program.callStack.Count)
                {
                    this.callStackListBox.DataSource = this.program.callStack.ToList();
                }

                if (this.codeLinesList.SelectedIndex != e.NextLine)
                {
                    this.codeLinesList.SelectedIndex = e.NextLine;
                }

                this.variableGrid.Refresh();
            }
        }
Пример #2
0
        void program_BeforeInstruction(object sender, Instruction_EventArgs e)
        {
            if (!this.debugEnabledCheckbox.Checked)
            {
                return;
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new EventHandler <Instruction_EventArgs>(this.program_BeforeInstruction), sender, e);
            }
            else
            {
                //this.variableGrid.Refresh();

                if (this.callStackListBox.Items.Count != this.program.callStack.Count)
                {
                    this.callStackListBox.DataSource = this.program.callStack.ToList();
                }

                if (this.codeLinesList.SelectedIndex != e.NextLine)
                {
                    this.codeLinesList.SelectedIndex = e.NextLine;
                }

                Thread.Sleep((int)this.numericUpDown1.Value);

                if (this.IsPaused)
                {
                    while (this.IsPaused && !this.doStep)
                    {
                        Thread.Sleep(10);
                        Application.DoEvents();
                    }
                    this.doStep = false;
                }
            }
        }