Skip to content

Commit 642d9eb

Browse files
committed
Code cleanup
1 parent 8036d5a commit 642d9eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+229
-840
lines changed

Source/NETworkManager.Setup/NETworkManager.Setup.vdproj

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@
7575
}
7676
"Entry"
7777
{
78-
"MsmKey" = "8:_44B804318D0349D6012EEB5DDACB53E8"
79-
"OwnerKey" = "8:_48ACD967FDBF43AEAF73122414146A86"
80-
"MsmSig" = "8:_UNDEFINED"
81-
}
82-
"Entry"
83-
{
8478
"MsmKey" = "8:_48ACD967FDBF43AEAF73122414146A86"
8579
"OwnerKey" = "8:_UNDEFINED"
8680
"MsmSig" = "8:_UNDEFINED"
@@ -99,6 +93,12 @@
9993
}
10094
"Entry"
10195
{
96+
"MsmKey" = "8:_650724BE2C6A73626C59721BB5A7AA68"
97+
"OwnerKey" = "8:_48ACD967FDBF43AEAF73122414146A86"
98+
"MsmSig" = "8:_UNDEFINED"
99+
}
100+
"Entry"
101+
{
102102
"MsmKey" = "8:_9A8619402B1C850D44680EEA483C9C4A"
103103
"OwnerKey" = "8:_48ACD967FDBF43AEAF73122414146A86"
104104
"MsmSig" = "8:_UNDEFINED"
@@ -220,7 +220,7 @@
220220
"Entry"
221221
{
222222
"MsmKey" = "8:_UNDEFINED"
223-
"OwnerKey" = "8:_44B804318D0349D6012EEB5DDACB53E8"
223+
"OwnerKey" = "8:_650724BE2C6A73626C59721BB5A7AA68"
224224
"MsmSig" = "8:_UNDEFINED"
225225
}
226226
"Entry"
@@ -589,20 +589,20 @@
589589
"IsDependency" = "11:TRUE"
590590
"IsolateTo" = "8:"
591591
}
592-
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_44B804318D0349D6012EEB5DDACB53E8"
592+
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4D64F059BE1802EEF044CE73194E762B"
593593
{
594594
"AssemblyRegister" = "3:1"
595595
"AssemblyIsInGAC" = "11:FALSE"
596-
"AssemblyAsmDisplayName" = "8:System.Net.IPNetwork, Version=2.2.0.94, Culture=neutral, PublicKeyToken=717343cc2c25edcf, processorArchitecture=MSIL"
596+
"AssemblyAsmDisplayName" = "8:Dragablz, Version=0.0.3.203, Culture=neutral, processorArchitecture=MSIL"
597597
"ScatterAssemblies"
598598
{
599-
"_44B804318D0349D6012EEB5DDACB53E8"
599+
"_4D64F059BE1802EEF044CE73194E762B"
600600
{
601-
"Name" = "8:System.Net.IPNetwork.dll"
601+
"Name" = "8:Dragablz.dll"
602602
"Attributes" = "3:512"
603603
}
604604
}
605-
"SourcePath" = "8:System.Net.IPNetwork.dll"
605+
"SourcePath" = "8:Dragablz.dll"
606606
"TargetName" = "8:"
607607
"Tag" = "8:"
608608
"Folder" = "8:_3C29CB23A70F44D4B1A9F285AFF37644"
@@ -620,20 +620,20 @@
620620
"IsDependency" = "11:TRUE"
621621
"IsolateTo" = "8:"
622622
}
623-
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4D64F059BE1802EEF044CE73194E762B"
623+
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_59613EA19958AC501CE05CC92FF31748"
624624
{
625625
"AssemblyRegister" = "3:1"
626626
"AssemblyIsInGAC" = "11:FALSE"
627-
"AssemblyAsmDisplayName" = "8:Dragablz, Version=0.0.3.203, Culture=neutral, processorArchitecture=MSIL"
627+
"AssemblyAsmDisplayName" = "8:Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"
628628
"ScatterAssemblies"
629629
{
630-
"_4D64F059BE1802EEF044CE73194E762B"
630+
"_59613EA19958AC501CE05CC92FF31748"
631631
{
632-
"Name" = "8:Dragablz.dll"
632+
"Name" = "8:Newtonsoft.Json.dll"
633633
"Attributes" = "3:512"
634634
}
635635
}
636-
"SourcePath" = "8:Dragablz.dll"
636+
"SourcePath" = "8:Newtonsoft.Json.dll"
637637
"TargetName" = "8:"
638638
"Tag" = "8:"
639639
"Folder" = "8:_3C29CB23A70F44D4B1A9F285AFF37644"
@@ -651,20 +651,20 @@
651651
"IsDependency" = "11:TRUE"
652652
"IsolateTo" = "8:"
653653
}
654-
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_59613EA19958AC501CE05CC92FF31748"
654+
"{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_650724BE2C6A73626C59721BB5A7AA68"
655655
{
656656
"AssemblyRegister" = "3:1"
657657
"AssemblyIsInGAC" = "11:FALSE"
658-
"AssemblyAsmDisplayName" = "8:Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"
658+
"AssemblyAsmDisplayName" = "8:System.Net.IPNetwork, Version=2.4.0.99, Culture=neutral, PublicKeyToken=717343cc2c25edcf, processorArchitecture=MSIL"
659659
"ScatterAssemblies"
660660
{
661-
"_59613EA19958AC501CE05CC92FF31748"
661+
"_650724BE2C6A73626C59721BB5A7AA68"
662662
{
663-
"Name" = "8:Newtonsoft.Json.dll"
663+
"Name" = "8:System.Net.IPNetwork.dll"
664664
"Attributes" = "3:512"
665665
}
666666
}
667-
"SourcePath" = "8:Newtonsoft.Json.dll"
667+
"SourcePath" = "8:System.Net.IPNetwork.dll"
668668
"TargetName" = "8:"
669669
"Tag" = "8:"
670670
"Folder" = "8:_3C29CB23A70F44D4B1A9F285AFF37644"
@@ -957,17 +957,6 @@
957957
"Property" = "8:ProgramMenuFolder"
958958
"Folders"
959959
{
960-
"{9EF0B969-E518-4E46-987F-47570745A589}:_6527B2E0C8E74EEC92CF3129DE6BEB9B"
961-
{
962-
"Name" = "8:NETworkManager"
963-
"AlwaysCreate" = "11:TRUE"
964-
"Condition" = "8:"
965-
"Transitive" = "11:FALSE"
966-
"Property" = "8:_5A21708B03994016AC7597DB51DA3EDB"
967-
"Folders"
968-
{
969-
}
970-
}
971960
}
972961
}
973962
}
@@ -1130,7 +1119,7 @@
11301119
"IconIndex" = "3:32512"
11311120
"Transitive" = "11:FALSE"
11321121
"Target" = "8:_48ACD967FDBF43AEAF73122414146A86"
1133-
"Folder" = "8:_6527B2E0C8E74EEC92CF3129DE6BEB9B"
1122+
"Folder" = "8:_EC8D1876085B42DE966689AC5A122D37"
11341123
"WorkingFolder" = "8:_3C29CB23A70F44D4B1A9F285AFF37644"
11351124
"Icon" = "8:_48ACD967FDBF43AEAF73122414146A86"
11361125
"Feature" = "8:"

Source/NETworkManager/ViewModels/ARPTableViewModel.cs

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using System.Windows;
1515
using MahApps.Metro.Controls;
1616
using NETworkManager.Models.Export;
17-
using NETworkManager.Enum;
1817

1918
namespace NETworkManager.ViewModels
2019
{
@@ -225,10 +224,7 @@ private void LoadSettings()
225224
#endregion
226225

227226
#region ICommands & Actions
228-
public ICommand RefreshCommand
229-
{
230-
get { return new RelayCommand(p => RefreshAction(), Refresh_CanExecute); }
231-
}
227+
public ICommand RefreshCommand => new RelayCommand(p => RefreshAction(), Refresh_CanExecute);
232228

233229
private bool Refresh_CanExecute(object paramter)
234230
{
@@ -242,10 +238,7 @@ private void RefreshAction()
242238
Refresh();
243239
}
244240

245-
public ICommand DeleteTableCommand
246-
{
247-
get { return new RelayCommand(p => DeleteTableAction(), DeleteTable_CanExecute); }
248-
}
241+
public ICommand DeleteTableCommand => new RelayCommand(p => DeleteTableAction(), DeleteTable_CanExecute);
249242

250243
private bool DeleteTable_CanExecute(object paramter)
251244
{
@@ -273,15 +266,9 @@ private async void DeleteTableAction()
273266
}
274267
}
275268

276-
public ICommand DeleteEntryCommand
277-
{
278-
get { return new RelayCommand(p => DeleteEntryAction(), DeleteEntry_CanExecute); }
279-
}
280-
281-
private bool DeleteEntry_CanExecute(object paramter)
282-
{
283-
return Application.Current.MainWindow != null && !((MetroWindow)Application.Current.MainWindow).IsAnyDialogOpen;
284-
}
269+
public ICommand DeleteEntryCommand => new RelayCommand(p => DeleteEntryAction(), DeleteEntry_CanExecute);
270+
271+
private bool DeleteEntry_CanExecute(object paramter) => Application.Current.MainWindow != null && !((MetroWindow)Application.Current.MainWindow).IsAnyDialogOpen;
285272

286273
private async void DeleteEntryAction()
287274
{
@@ -304,15 +291,9 @@ private async void DeleteEntryAction()
304291
}
305292
}
306293

307-
public ICommand AddEntryCommand
308-
{
309-
get { return new RelayCommand(p => AddEntryAction(), AddEntry_CanExecute); }
310-
}
294+
public ICommand AddEntryCommand => new RelayCommand(p => AddEntryAction(), AddEntry_CanExecute);
311295

312-
private bool AddEntry_CanExecute(object paramter)
313-
{
314-
return Application.Current.MainWindow != null && !((MetroWindow)Application.Current.MainWindow).IsAnyDialogOpen;
315-
}
296+
private bool AddEntry_CanExecute(object paramter) => Application.Current.MainWindow != null && !((MetroWindow)Application.Current.MainWindow).IsAnyDialogOpen;
316297

317298
private async void AddEntryAction()
318299
{
@@ -355,40 +336,28 @@ private async void AddEntryAction()
355336
await _dialogCoordinator.ShowMetroDialogAsync(this, customDialog);
356337
}
357338

358-
public ICommand CopySelectedIPAddressCommand
359-
{
360-
get { return new RelayCommand(p => CopySelectedIPAddressAction()); }
361-
}
339+
public ICommand CopySelectedIPAddressCommand => new RelayCommand(p => CopySelectedIPAddressAction());
362340

363341
private void CopySelectedIPAddressAction()
364342
{
365343
CommonMethods.SetClipboard(SelectedARPInfo.IPAddress.ToString());
366344
}
367345

368-
public ICommand CopySelectedMACAddressCommand
369-
{
370-
get { return new RelayCommand(p => CopySelectedMACAddressAction()); }
371-
}
346+
public ICommand CopySelectedMACAddressCommand => new RelayCommand(p => CopySelectedMACAddressAction());
372347

373348
private void CopySelectedMACAddressAction()
374349
{
375350
CommonMethods.SetClipboard(MACAddressHelper.GetDefaultFormat(SelectedARPInfo.MACAddress.ToString()));
376351
}
377352

378-
public ICommand CopySelectedMulticastCommand
379-
{
380-
get { return new RelayCommand(p => CopySelectedMulticastAction()); }
381-
}
353+
public ICommand CopySelectedMulticastCommand => new RelayCommand(p => CopySelectedMulticastAction());
382354

383355
private void CopySelectedMulticastAction()
384356
{
385357
CommonMethods.SetClipboard(SelectedARPInfo.IsMulticast ? Resources.Localization.Strings.Yes : Resources.Localization.Strings.No);
386358
}
387359

388-
public ICommand ExportCommand
389-
{
390-
get { return new RelayCommand(p => ExportAction()); }
391-
}
360+
public ICommand ExportCommand => new RelayCommand(p => ExportAction());
392361

393362
private async void ExportAction()
394363
{

Source/NETworkManager/ViewModels/AboutViewModel.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,8 @@ private void CheckForUpdates()
190190

191191
updater.Check();
192192
}
193-
194-
public void OpenLicenseFolder()
195-
{
196-
Process.Start(LibraryManager.GetLicenseLocation());
197-
}
193+
194+
public void OpenLicenseFolder() => Process.Start(LibraryManager.GetLicenseLocation());
198195
#endregion
199196

200197
#region Events

Source/NETworkManager/ViewModels/ConnectionsViewModel.cs

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using MahApps.Metro.Controls;
1414
using MahApps.Metro.Controls.Dialogs;
1515
using NETworkManager.Models.Export;
16-
using NETworkManager.Enum;
1716
using NETworkManager.Views;
1817

1918
namespace NETworkManager.ViewModels
@@ -223,10 +222,7 @@ private void LoadSettings()
223222
#endregion
224223

225224
#region ICommands & Actions
226-
public ICommand RefreshCommand
227-
{
228-
get { return new RelayCommand(p => RefreshAction(), Refresh_CanExecute); }
229-
}
225+
public ICommand RefreshCommand => new RelayCommand(p => RefreshAction(), Refresh_CanExecute);
230226

231227
private bool Refresh_CanExecute(object paramter)
232228
{
@@ -240,70 +236,49 @@ private void RefreshAction()
240236
Refresh();
241237
}
242238

243-
public ICommand CopySelectedLocalIpAddressCommand
244-
{
245-
get { return new RelayCommand(p => CopySelectedLocalIpAddressAction()); }
246-
}
239+
public ICommand CopySelectedLocalIpAddressCommand => new RelayCommand(p => CopySelectedLocalIpAddressAction());
247240

248241
private void CopySelectedLocalIpAddressAction()
249242
{
250243
CommonMethods.SetClipboard(SelectedConnectionInfo.LocalIPAddress.ToString());
251244
}
252245

253-
public ICommand CopySelectedLocalPortCommand
254-
{
255-
get { return new RelayCommand(p => CopySelectedLocalPortAction()); }
256-
}
246+
public ICommand CopySelectedLocalPortCommand => new RelayCommand(p => CopySelectedLocalPortAction());
257247

258248
private void CopySelectedLocalPortAction()
259249
{
260250
CommonMethods.SetClipboard(SelectedConnectionInfo.LocalPort.ToString());
261251
}
262252

263-
public ICommand CopySelectedRemoteIpAddressCommand
264-
{
265-
get { return new RelayCommand(p => CopySelectedRemoteIpAddressAction()); }
266-
}
253+
public ICommand CopySelectedRemoteIpAddressCommand => new RelayCommand(p => CopySelectedRemoteIpAddressAction());
267254

268255
private void CopySelectedRemoteIpAddressAction()
269256
{
270257
CommonMethods.SetClipboard(SelectedConnectionInfo.RemoteIPAddress.ToString());
271258
}
272259

273-
public ICommand CopySelectedRemotePortCommand
274-
{
275-
get { return new RelayCommand(p => CopySelectedRemotePortAction()); }
276-
}
260+
public ICommand CopySelectedRemotePortCommand => new RelayCommand(p => CopySelectedRemotePortAction());
277261

278262
private void CopySelectedRemotePortAction()
279263
{
280264
CommonMethods.SetClipboard(SelectedConnectionInfo.RemotePort.ToString());
281265
}
282266

283-
public ICommand CopySelectedProtocolCommand
284-
{
285-
get { return new RelayCommand(p => CopySelectedProtocolAction()); }
286-
}
267+
public ICommand CopySelectedProtocolCommand => new RelayCommand(p => CopySelectedProtocolAction());
287268

288269
private void CopySelectedProtocolAction()
289270
{
290271
CommonMethods.SetClipboard(SelectedConnectionInfo.Protocol.ToString());
291272
}
292273

293-
public ICommand CopySelectedStateCommand
294-
{
295-
get { return new RelayCommand(p => CopySelectedStateAction()); }
296-
}
274+
public ICommand CopySelectedStateCommand => new RelayCommand(p => CopySelectedStateAction());
297275

298276
private void CopySelectedStateAction()
299277
{
300278
CommonMethods.SetClipboard(Resources.Localization.Strings.ResourceManager.GetString("TcpState_" + SelectedConnectionInfo.TcpState, LocalizationManager.Culture));
301279
}
302280

303-
public ICommand ExportCommand
304-
{
305-
get { return new RelayCommand(p => ExportAction()); }
306-
}
281+
public ICommand ExportCommand => new RelayCommand(p => ExportAction());
307282

308283
private async void ExportAction()
309284
{

Source/NETworkManager/ViewModels/CredentialViewModel.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,8 @@ public CredentialViewModel(Action<CredentialViewModel> saveCommand, Action<Crede
148148
_isLoading = false;
149149
}
150150

151-
public void HasCredentialInfoChanged()
152-
{
153-
CredentialInfoChanged = (_credentialInfo.Name != Name) || (_credentialInfo.Username != Username) || (SecureStringHelper.ConvertToString(_credentialInfo.Password) != SecureStringHelper.ConvertToString(Password));
154-
}
151+
public void HasCredentialInfoChanged() => CredentialInfoChanged = (_credentialInfo.Name != Name) || (_credentialInfo.Username != Username) || (SecureStringHelper.ConvertToString(_credentialInfo.Password) != SecureStringHelper.ConvertToString(Password));
155152

156-
private void ValidatePassword()
157-
{
158-
PasswordIsEmpty = (Password == null || Password.Length == 0);
159-
}
153+
private void ValidatePassword() => PasswordIsEmpty = Password == null || Password.Length == 0;
160154
}
161155
}

Source/NETworkManager/ViewModels/CredentialsMasterPasswordViewModel.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ public CredentialsMasterPasswordViewModel(Action<CredentialsMasterPasswordViewMo
4848
CancelCommand = new RelayCommand(p => cancelHandler(this));
4949
}
5050

51-
private void ValidatePassword()
52-
{
53-
IsPasswordEmpty = (Password == null || Password.Length == 0);
54-
}
51+
private void ValidatePassword() => IsPasswordEmpty = Password == null || Password.Length == 0;
5552
}
5653
}

0 commit comments

Comments
 (0)