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