UdpLog.cs 569 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Windows;
  3. namespace FastGithub.UI
  4. {
  5. public class UdpLog
  6. {
  7. public DateTime Timestamp { get; set; }
  8. public LogLevel Level { get; set; }
  9. public string Message { get; set; } = string.Empty;
  10. public string SourceContext { get; set; } = string.Empty;
  11. public string Color => this.Level <= LogLevel.Information ? "#333" : "IndianRed";
  12. public void SetToClipboard()
  13. {
  14. Clipboard.SetText($"{this.Timestamp:yyyy-MM-dd HH:mm:ss.fff}\r\n{this.Message}");
  15. }
  16. }
  17. }