Write() public static method

public static Write ( MessageType type, string message ) : void
type MessageType
message string
return void
示例#1
0
 public virtual void End(object obj)
 {
     lock (Printer.SyncObject)
     {
         Update(obj);
         Printer.Write(MessageType.Interactive, "\n");
         Printer.LastPrinter = null;
     }
 }
示例#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;
 }
示例#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;
     }
 }
示例#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;
 }
示例#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);
     }
 }
示例#6
0
 public override void Flush()
 {
     Printer.Write(MessageType.Message, Text.ToString());
     Text.Clear();
 }