示例#1
0
        //send char to console.
        public void SendChar(char c)
        {
            SendToConsoleEventArgs e = new SendToConsoleEventArgs();

            e.c = c;
            onOutputDetected(e);
        }
示例#2
0
        }//display a char form the Computer class.

        private void UpdateConsole(object sender, SendToConsoleEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new ConsoleUpdateDelegate(UpdateConsole), e);
                return;
            }
        }
示例#3
0
        //sends output to the Form1 model class using Event mechanism
        public void onOutputDetected(SendToConsoleEventArgs e)
        {
            EventHandler <SendToConsoleEventArgs> handler = ConsoleChar;

            if (handler != null)
            {
                handler(this, e);
            }
        }
示例#4
0
 public void UpdateConsole(SendToConsoleEventArgs e)
 {
     terminalBox.AppendText(e.c.ToString());
 }