Winify – Diff between revs 42 and 43
?pathlinks?
Rev 42 | Rev 43 | |||
---|---|---|---|---|
Line 28... | Line 28... | |||
28 | |
28 | |
|
Line 29... | Line 29... | |||
29 | public Configuration.Configuration Configuration { get; set; } |
29 | public Configuration.Configuration Configuration { get; set; } |
|
Line -... | Line 30... | |||
- | 30 | |
||
- | 31 | public ScheduledContinuation ChangedConfigurationContinuation { get; set; } |
||
30 | |
32 | |
|
Line 31... | Line 33... | |||
31 | public ScheduledContinuation ChangedConfigurationContinuation { get; set; } |
33 | public bool MemorySinkEnabled { get; set; } |
|
Line 32... | Line 34... | |||
32 | |
34 | |
|
Line 44... | Line 46... | |||
44 | |
46 | |
|
Line 45... | Line 47... | |||
45 | private readonly CancellationTokenSource _cancellationTokenSource; |
47 | private readonly CancellationTokenSource _cancellationTokenSource; |
|
Line -... | Line 48... | |||
- | 48 | |
||
- | 49 | private readonly CancellationToken _cancellationToken; |
||
- | 50 | |
||
- | 51 | private LogViewForm _logViewForm; |
||
46 | |
52 | |
|
Line 47... | Line 53... | |||
47 | private readonly CancellationToken _cancellationToken; |
53 | private readonly LogMemorySink _memorySink; |
|
Line 48... | Line 54... | |||
48 | |
54 | |
|
Line 60... | Line 66... | |||
60 | |
66 | |
|
61 | public MainForm(Mutex mutex) : this() |
67 | public MainForm(Mutex mutex) : this() |
|
62 | { |
68 | { |
|
Line -... | Line 69... | |||
- | 69 | InitializeComponent(); |
||
63 | InitializeComponent(); |
70 | |
|
64 | |
71 | _memorySink = new LogMemorySink(); |
|
- | 72 | Log.Logger = new LoggerConfiguration() |
||
65 | Log.Logger = new LoggerConfiguration() |
73 | .MinimumLevel.Debug() |
|
66 | .MinimumLevel.Debug() |
74 | .WriteTo.Conditional(condition => MemorySinkEnabled, configureSink => configureSink.Sink(_memorySink)) |
|
67 | .WriteTo.File(Path.Combine(Constants.UserApplicationDirectory, "Logs", $"{Constants.AssemblyName}.log"), |
75 | .WriteTo.File(Path.Combine(Constants.UserApplicationDirectory, "Logs", $"{Constants.AssemblyName}.log"), |
|
Line 68... | Line 76... | |||
68 | rollingInterval: RollingInterval.Day) |
76 | rollingInterval: RollingInterval.Day) |
|
Line 296... | Line 304... | |||
296 | var deviceId = Miscellaneous.GetMachineGuid(); |
304 | var deviceId = Miscellaneous.GetMachineGuid(); |
|
297 | var @protected = new Servers.Servers |
305 | var @protected = new Servers.Servers |
|
298 | { |
306 | { |
|
299 | Server = new BindingListWithCollectionChanged<Server>() |
307 | Server = new BindingListWithCollectionChanged<Server>() |
|
300 | }; |
308 | }; |
|
- | 309 | |
||
301 | foreach (var server in servers.Server) |
310 | foreach (var server in servers.Server) |
|
302 | { |
311 | { |
|
303 | var password = Encoding.UTF8.GetBytes(server.Password); |
312 | var password = Encoding.UTF8.GetBytes(server.Password); |
|
304 | var encrypted = await AES.Encrypt(password, deviceId); |
313 | var encrypted = await AES.Encrypt(password, deviceId); |
|
305 | var armored = Convert.ToBase64String(encrypted); |
314 | var armored = Convert.ToBase64String(encrypted); |
|
Line 375... | Line 384... | |||
375 | return new Servers.Servers(); |
384 | return new Servers.Servers(); |
|
376 | } |
385 | } |
|
377 | } |
386 | } |
|
Line 378... | Line 387... | |||
378 | |
387 | |
|
- | 388 | #endregion |
||
- | 389 | |
||
- | 390 | private void LogViewToolStripMenuItem_Click(object sender, EventArgs e) |
||
- | 391 | { |
||
- | 392 | if (_logViewForm != null) |
||
- | 393 | { |
||
- | 394 | return; |
||
- | 395 | } |
||
- | 396 | |
||
- | 397 | _logViewForm = new LogViewForm(this, _memorySink, _cancellationToken); |
||
- | 398 | _logViewForm.Closing += LogViewForm_Closing; |
||
- | 399 | _logViewForm.Show(); |
||
- | 400 | } |
||
- | 401 | |
||
- | 402 | private void LogViewForm_Closing(object sender, CancelEventArgs e) |
||
- | 403 | { |
||
- | 404 | if (_logViewForm == null) |
||
- | 405 | { |
||
- | 406 | return; |
||
- | 407 | } |
||
- | 408 | |
||
- | 409 | _logViewForm.Closing -= LogViewForm_Closing; |
||
- | 410 | _logViewForm.Close(); |
||
- | 411 | _logViewForm = null; |
||
379 | #endregion |
412 | } |
|
380 | } |
413 | } |
|
381 | } |
414 | } |