TextOutputGeneratedEventArgs Class

Provides data for the TextOutputGenerated event.

Namespace: XJTAG.Integration.XJRunner

Syntax

public class TextOutputGeneratedEventArgs : EventArgs

Example

This example shows how, when handling the TextOutputGenerated Event, the TextOutputGeneratedEventArgs are used to display the generated text in different colours in a console depending on the type of text produced.

 class Program
 {
        static Runner runner;
        static TestCollection testList;

        static void Main(string[] args)
        {
            /*
             * ...
             * Code to obtain Runner object from project and get test list.
             * ...
             */

            // Subscribe to TestingStarted event.
            runner.TextOutputGenerated += runner_TextOutputGenerated;

            /*
             * ...
             * Code running tests and disposal of Runner Integration objects.
             * ...
             */
        }

        static void runner_TextOutputGenerated(object sender, TextOutputGeneratedEventArgs e)
        {
            // Use the TextOutputGeneratedEventArgs to determine the type of the generated
            // output text.
            switch (e.Type)
            {
                case OutputTextType.Pass:
                    Console.BackgroundColor = ConsoleColor.DarkGreen;
                    break;
                case OutputTextType.Error:
                    Console.BackgroundColor = ConsoleColor.DarkRed;
                    break;
                default:
                    Console.ResetColor();
                    break;
            }

            Console.Write(e.Text);
            }
 }

Inheritance Hierarchy

  • EventArgs
    • object

Members

Fields

Name Description
Text

The text that is being output.

Type

The type of output.

Methods

Name Description
Equals(object) (from object)
Finalize (from object)
GetHashCode (from object)
GetType (from object)
MemberwiseClone (from object)
ToString (from object)