Exemplo n.º 1
0
 /// <summary>
 /// Removes an event handler that listens for ouput events.
 /// </summary>
 /// <param name="outputEventHandler">The event handler to be removed.</param>
 public static void RemoveOutputEventHandler(OutputEventHandler outputEventHandler)
 {
     lock (_lock)
     {
         _outputEventHandler -= outputEventHandler;
     }
 }
        private void Send(string line, OutputLevel level, bool isNested)
        {
            if (IsQuiet)
            {
                return;
            }

            List <string> lines = new List <string>();

            lines.Add(line);

            OutputEventHandler handler = OnOutput;

            if (handler != null)
            {
                OutputEventArgs e = new OutputEventArgs()
                {
                    Lines    = lines,
                    Level    = level,
                    Indent   = CurrentIndent,
                    IsNested = isNested
                };

                handler(this, e);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds an event handler to listen for ouput events.
 /// </summary>
 /// <param name="outputEventHandler">The event handler to be added.</param>
 public static void AddOutputEventHandler(OutputEventHandler outputEventHandler)
 {
     lock (_lock)
     {
         _outputEventHandler += outputEventHandler;
     }
 }
Exemplo n.º 4
0
        public void WriteLine(string text)
        {
            // We call the OutputRecieved event here, this will be used by LogMuffin
            // to get informed of new console outputs.
            OutputEventHandler handler = this.OutputRecieved;

            if (handler != null)
            {
                handler(this, text);
            }


            // Write the recieved text to the console.
            Console.WriteLine(text);
        }
Exemplo n.º 5
0
 public ConsoleRedirect(OutputEventHandler output)
 {
     this.Output = output;
 }