Example #1
0
 private void assembleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SimulatorDisplayQueue.Clear();
     SimulatorList.ListToExecute.Clear();
     SimulatorParameters.ResetCounter();
     txtBoxMachineCode.Clear();
     txtBoxErrors.Clear();
     for (int i = 0; i < txtBoxMnemonics.Lines.Count(); i++)
     {
         string text = txtBoxMnemonics.Lines[i];
         if (!String.IsNullOrEmpty(text))
         {
             try
             {
                 text = TextParser.LineParse(text);
                 txtBoxMachineCode.AppendText(text);
             }
             catch (InstructionException ex)
             {
                 FormatErrorText(ex.Message, i);
             }
             catch (ParameterException ex)
             {
                 FormatErrorText(ex.Message, i);
             }
             txtBoxMachineCode.AppendText(Environment.NewLine);
         }
     }
 }
Example #2
0
        private void NewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SimulatorDisplayQueue.Clear();
            SimulatorList.ListToExecute.Clear();
            SimulatorParameters.ResetCounter();
            DialogResult dialogResult = MessageBox.Show("Any unsaved changes will be lost. Continue?", "New File", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                txtBoxMnemonics.Clear();
                txtBoxMachineCode.Clear();
                txtBoxErrors.Clear();
            }
        }
Example #3
0
 private void OnClose(object sender, EventArgs e)
 {
     SimulatorDisplayQueue.Clear();
     SimulatorList.ListToExecute.Clear();
 }