Write() public static method

public static Write ( MessageType type, string message ) : void
type MessageType
message string
return void
Example #1
0
 public virtual void End(object obj)
 {
     lock (Printer.SyncObject)
     {
         Update(obj);
         Printer.Write(MessageType.Interactive, "\n");
         Printer.LastPrinter = null;
     }
 }
Example #2
0
 internal override void Start(string title)
 {
     Header = title + ": ";
     lock (Printer.SyncObject)
     {
         Printer.ClearInteractive();
         Printer.Write(MessageType.Interactive, Header);
         Printer.LastPrinter = this;
         ConsoleLeft         = System.Console.CursorLeft;
     }
     Last = string.Empty;
 }
Example #3
0
 public override void End(object obj)
 {
     lock (Printer.SyncObject)
     {
         if (Printer.LastPrinter != this)
         {
             Printer.ClearInteractive();
             Printer.LastPrinter = this;
             ConsoleLeft         = 0;
         }
         string lastValue = Final == null ? string.Empty : Final;
         string bar       = new string(' ', lastValue.Length);
         System.Console.CursorLeft = 0;
         Printer.Write(MessageType.Interactive, bar);
         System.Console.CursorLeft = 0;
         Printer.LastPrinter       = null;
     }
 }
Example #4
0
 internal override void Start(string title)
 {
     if (string.IsNullOrEmpty(title))
     {
         Header = null;
     }
     else
     {
         Header = title + ":\n";
     }
     lock (Printer.SyncObject)
     {
         if (!string.IsNullOrEmpty(Header))
         {
             Printer.Write(MessageType.Interactive, Header);
         }
         Printer.LastPrinter = this;
         ConsoleLeft         = System.Console.CursorLeft;
     }
     Last = string.Empty;
 }
Example #5
0
 public override void Update(object amount)
 {
     lock (Printer.SyncObject)
     {
         if (Printer.LastPrinter != this)
         {
             Printer.ClearInteractive();
             Printer.Write(MessageType.Interactive, Header);
             Printer.LastPrinter = this;
             ConsoleLeft         = System.Console.CursorLeft;
         }
         string last = Last;
         Last = Formatter(amount);
         System.Console.CursorLeft = ConsoleLeft;
         string output = Last;
         while (output.Length < last.Length)
         {
             output += ' ';
         }
         System.Console.CursorLeft = ConsoleLeft;
         Write(MessageType.Interactive, output);
     }
 }
Example #6
0
 public override void Flush()
 {
     Printer.Write(MessageType.Message, Text.ToString());
     Text.Clear();
 }