-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLogEvent.cs
More file actions
35 lines (29 loc) · 868 Bytes
/
LogEvent.cs
File metadata and controls
35 lines (29 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable UnusedMember.Global
namespace Hi3Helper.Http
{
public enum DownloadLogSeverity
{
Info,
Error,
Warning
}
public class LogEvent
{
public string Message { get; private set; }
public DownloadLogSeverity Severity { get; private set; }
private LogEvent(string message, DownloadLogSeverity severity)
{
Message = message;
Severity = severity;
}
// Download Progress Event Handler
public static event EventHandler<LogEvent>? DownloadEvent;
// Push log to listener
public static void PushLog(string message, DownloadLogSeverity severity)
{
DownloadEvent?.Invoke(null, new LogEvent(message, severity));
}
}
}