The ProcessEventArgs are arguments for a console event.
상속: System.EventArgs
예제 #1
0
        /// <summary>
        /// Handles the OnProcessOutput event of the processInterace control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="args">The <see cref="ProcessInterface.ProcessEventArgs"/> instance containing the event data.</param>
        void processInterace_OnProcessOutput(object sender, ProcessInterface.ProcessEventArgs args)
        {
            //  Write the output, in white
            WriteOutput(args.Content, Color.White);

            //  Fire the output event.
            FireConsoleOutputEvent(args.Content);
        }
예제 #2
0
        /// <summary> Handles the OnProcessError event of the processInterace control. </summary>
        /// <param name="sender"> The source of the event. </param>
        /// <param name="args">
        /// The <see cref="ProcessEventArgs" /> instance containing the event data.
        /// </param>
        private void processInterace_OnProcessError(object sender, ProcessInterface.ProcessEventArgs args)
        {
            // Write the output, in red
            WriteOutput(args.Content, Color.Red);

            // Fire the output event.
            FireConsoleOutputEvent(args.Content);
        }
예제 #3
0
        /// <summary> Handles the OnProcessOutput event of the processInterace control. </summary>
        /// <param name="sender"> The source of the event. </param>
        /// <param name="args">
        /// The <see cref="ProcessEventArgs" /> instance containing the event data.
        /// </param>
        private void processInterace_OnProcessOutput(object sender, ProcessInterface.ProcessEventArgs args)
        {
            // Write the output, in white
            this.richTextBoxConsole.SuspendLayout();
            WriteOutput(args.Content, Color.White);

            // Fire the output event.
            FireConsoleOutputEvent(args.Content);
            this.richTextBoxConsole.ResumeLayout();
        }
예제 #4
0
        /// <summary> Handles the OnProcessExit event of the processInterace control. </summary>
        /// <param name="sender"> The source of the event. </param>
        /// <param name="args">
        /// The <see cref="ProcessEventArgs" /> instance containing the event data.
        /// </param>
        private void processInterace_OnProcessExit(object sender, ProcessInterface.ProcessEventArgs args)
        {
            // Are we showing diagnostics?
            if (ShowDiagnostics)
            {
                WriteOutput(System.Environment.NewLine + processInterace.ProcessFileName + " exited.", Color.FromArgb(255, 0, 255, 0));
            }

            // Read only again.
            Invoke((Action)(() => {
                richTextBoxConsole.ReadOnly = true;
            }));
        }
예제 #5
0
 /// <summary>
 /// Handles the OnProcessInput event of the processInterace control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="args">The <see cref="ProcessInterface.ProcessEventArgs"/> instance containing the event data.</param>
 void processInterace_OnProcessInput(object sender, ProcessInterface.ProcessEventArgs args)
 {
     throw new NotImplementedException();
 }
예제 #6
0
        void processInterace_OnProcessOutput(object sender, ProcessEventArgs args)
        {
            if (args.Content.Equals(_lastInput))
            {
                screendata[screendata.Count - 1] = screendata[screendata.Count - 1] + args.Content.Replace("\r\n", "");
                LoadScreenBuffer();
                return;
            }

            //screen size is 80 by 25
            if (args.Content.Equals("\f"))
            {
                screendata.Clear();
            }
            else
            {
                //for the purposes of this demonstration, output termination marker will be '>'
                //thinking that it would be best if the caret location from Console API / colum from buffer might be better.
                if (args.Content.Length == 0)   //console has probably been reset
                {
                    return;
                }
                string[] data = args.Content.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                _buffer += args.Content;
                if (_buffer.Substring(_buffer.Length - 1).Equals(">"))
                {
                    //we've hit output termination marker. parse it
                    data = _buffer.Split(new string[] { "\r\n" }, StringSplitOptions.None);
                    _buffer = "";
                    //add it to the list
                    for (int i = 0; i < data.Length; i++)
                    {
                        screendata.Add(data[i]);
                    }

                    //parse it
                    LoadScreenBuffer();

                    //do we have any conditions to process?
                    if (Conditions.Count != 0)
                    {
                        EvalConditions();
                    }
                }
            }

            //if (screendata.Count == 0)
            //{
            //    CurrentLocation.Column = 0;
            //}
            //else
            //{
            //    CurrentLocation.Column = screendata[screendata.Count - 1].ToString().Length;
            //}
        }
예제 #7
0
 void processInterace_OnProcessInput(object sender, ProcessEventArgs args)
 {
     throw new NotImplementedException();
 }
예제 #8
0
 void processInterace_OnProcessExit(object sender, ProcessEventArgs args)
 {
     //do we need to bubble this up?
     //throw new NotImplementedException();
 }
예제 #9
0
 void processInterace_OnProcessError(object sender, ProcessEventArgs args)
 {
     //why is this firing?
     //throw new NotImplementedException();
 }