-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathModels.cs
More file actions
190 lines (168 loc) · 6.25 KB
/
Copy pathModels.cs
File metadata and controls
190 lines (168 loc) · 6.25 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace LanScoutWin;
public sealed class NetworkAdapterInfo
{
public string Name { get; init; } = "";
public string Description { get; init; } = "";
public string Address { get; init; } = "";
public int PrefixLength { get; init; }
public string Gateway { get; init; } = "";
public string NetworkLabel => $"{Address}/{PrefixLength}";
public override string ToString() => $"{Name} - {NetworkLabel}";
}
public sealed class DeviceResult
{
public string IpAddress { get; init; } = "";
public string HostName { get; init; } = "";
public string MacAddress { get; init; } = "";
public string Vendor { get; init; } = "";
public string OperatingSystemHint { get; init; } = "";
public string OpenPorts { get; init; } = "";
public long PingMs { get; init; }
public string Status { get; init; } = "";
}
public sealed class InternetTestResult
{
public DateTimeOffset Timestamp { get; init; } = DateTimeOffset.Now;
public double AveragePingMs { get; init; }
public double JitterMs { get; init; }
public double DownloadMbps { get; init; }
public double UploadMbps { get; init; }
public string Protocol { get; init; } = "";
public string Notes { get; init; } = "";
}
public sealed class WifiInfo
{
public string Scope { get; init; } = "";
public string Ssid { get; init; } = "";
public string Signal { get; init; } = "";
public string Channel { get; init; } = "";
public string Band { get; init; } = "";
public string ReceiveRate { get; init; } = "";
public string TransmitRate { get; init; } = "";
public string Authentication { get; init; } = "";
}
public sealed class LanPerformanceResult
{
public DateTimeOffset Timestamp { get; init; } = DateTimeOffset.Now;
public string TargetPath { get; init; } = "";
public int FileSizeMb { get; init; }
public double WriteMbps { get; init; }
public double ReadMbps { get; init; }
public string Notes { get; init; } = "";
}
public sealed class LogFileInfo
{
public string Name { get; init; } = "";
public string FullPath { get; init; } = "";
public DateTime LastWriteTime { get; init; }
public long SizeBytes { get; init; }
}
public sealed class TraceHop
{
public int Hop { get; init; }
public string Latency1 { get; init; } = "";
public string Latency2 { get; init; } = "";
public string Latency3 { get; init; } = "";
public string Target { get; init; } = "";
public string Status { get; init; } = "";
}
public sealed class NetworkConfigItem
{
public string Adapter { get; init; } = "";
public string IPv4 { get; init; } = "";
public string Gateway { get; init; } = "";
public string DhcpServer { get; init; } = "";
public string DnsServers { get; init; } = "";
public string Lease { get; init; } = "";
}
public sealed class PortScanResult
{
public string Host { get; init; } = "";
public int Port { get; init; }
public string Service { get; init; } = "";
public string State { get; init; } = "";
public long DurationMs { get; init; }
}
public sealed class ConnectionInfo
{
public string Protocol { get; init; } = "";
public string LocalAddress { get; init; } = "";
public string LocalPort { get; init; } = "";
public string RemoteAddress { get; init; } = "";
public string RemotePort { get; init; } = "";
public string State { get; init; } = "";
public string ProcessId { get; init; } = "";
public string ProcessName { get; init; } = "";
}
public sealed class WifiQualitySample
{
public DateTime Timestamp { get; init; } = DateTime.Now;
public string Ssid { get; init; } = "";
public string Signal { get; init; } = "";
public string Channel { get; init; } = "";
public string Band { get; init; } = "";
public string ReceiveRate { get; init; } = "";
public string TransmitRate { get; init; } = "";
}
public sealed class WifiChannelSummary
{
public string Channel { get; init; } = "";
public string Band { get; init; } = "";
public int NetworkCount { get; init; }
public string StrongestSignal { get; init; } = "";
public string Ssids { get; init; } = "";
}
public sealed class WifiProfileInfo
{
public string Name { get; init; } = "";
public string Authentication { get; init; } = "";
public string Encryption { get; init; } = "";
public string AutoConnect { get; init; } = "";
}
public sealed class AppState : INotifyPropertyChanged
{
private string _status = "Bereit";
private int _scanProgress;
private bool _isBusy;
public ObservableCollection<NetworkAdapterInfo> Adapters { get; } = [];
public ObservableCollection<DeviceResult> Devices { get; } = [];
public ObservableCollection<InternetTestResult> InternetTests { get; } = [];
public ObservableCollection<WifiInfo> WifiItems { get; } = [];
public ObservableCollection<LanPerformanceResult> LanTests { get; } = [];
public ObservableCollection<LogFileInfo> LogFiles { get; } = [];
public ObservableCollection<TraceHop> TraceHops { get; } = [];
public ObservableCollection<NetworkConfigItem> NetworkConfig { get; } = [];
public ObservableCollection<PortScanResult> PortScanResults { get; } = [];
public ObservableCollection<ConnectionInfo> Connections { get; } = [];
public ObservableCollection<WifiQualitySample> WifiHistory { get; } = [];
public ObservableCollection<WifiChannelSummary> WifiChannels { get; } = [];
public ObservableCollection<WifiProfileInfo> WifiProfiles { get; } = [];
public string Status
{
get => _status;
set => SetField(ref _status, value);
}
public int ScanProgress
{
get => _scanProgress;
set => SetField(ref _scanProgress, value);
}
public bool IsBusy
{
get => _isBusy;
set => SetField(ref _isBusy, value);
}
public event PropertyChangedEventHandler? PropertyChanged;
private void SetField<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value))
{
return;
}
field = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}