The ProcessEventArgs are arguments for a console event.
Inheritance: 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);
        }
        /// <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);
        }
        /// <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();
        }
        /// <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();
 }