-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathILogging.cs
More file actions
90 lines (73 loc) · 3.14 KB
/
ILogging.cs
File metadata and controls
90 lines (73 loc) · 3.14 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using AoShinhoServ_Monitor.Forms;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Forms;
using MenuItem = System.Windows.Forms.MenuItem;
namespace AoShinhoServ_Monitor
{
internal class ILogging
{
public static NotifyIcon _notifyIcon;
public static readonly ContextMenu trayMenu = new ContextMenu();
public static short CounterError { set; get; }
public static short CounterSql { set; get; }
public static short CounterWarning { set; get; }
public static short CounterDebug { set; get; }
public static short CounterOnline { set; get; }
public static bool OnOff { set; get; }
public static bool IsDragging { set; get; }
public static Point MousePosition { set; get; }
public static Thickness StartMargin { set; get; }
public static Thickness StopMargin { set; get; }
public static Thickness OptionMargin { set; get; }
public static Thickness RestartMargin { set; get; }
public static Thickness CompileMargin { set; get; }
public static Thickness StartWSMargin { set; get; }
public static Thickness StartROBMargin { set; get; }
public static Thickness BuildROBMargin { set; get; }
public static Thickness OptionSaveMargin { set; get; }
public static Thickness OptionCancelMargin { set; get; }
public static ROServers.Data LastErrorLog { set; get; }
public static List<ROServers.ProcessesInfo> processesInfos = new List<ROServers.ProcessesInfo>();
public static readonly List<ROServers.Error> errorLogs = new List<ROServers.Error>();
public static OptionsWnd OptWin = new OptionsWnd();
public static Logs LogWin = new Logs();
#region LogWinRelated
public static void Add_ErrorLog(ROServers.Data Data)
{
errorLogs.Add(new ROServers.Error { Header = Data.Header, Body = Data.Body });
Task.Run(() => UpdateContextMenu());
}
#endregion LogWinRelated
#region tray
public static void UpdateContextMenu()
{
foreach (MenuItem menuItem in trayMenu.MenuItems)
{
string[] menuItemTextParts = menuItem.Text.Split(':');
string variableName = menuItemTextParts[0];
switch (variableName)
{
case "Error":
menuItem.Text = $"Error: {CounterError}";
break;
case "SQL":
menuItem.Text = $"SQL: {CounterSql}";
break;
case "Warning":
menuItem.Text = $"Warning: {CounterWarning}";
break;
case "Debug":
menuItem.Text = $"Debug: {CounterDebug}";
break;
case "Online":
menuItem.Text = $"Online: {CounterOnline}";
break;
}
}
_notifyIcon.ContextMenu = trayMenu;
}
#endregion tray
}
}