Skip to content

Commit e140d36

Browse files
committed
1 parent 47af67b commit e140d36

16 files changed

Lines changed: 70 additions & 30 deletions

Source/NETworkManager/ViewModels/CredentialViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ public bool IsEdited
129129
}
130130
}
131131

132-
public CredentialViewModel(Action<CredentialViewModel> saveCommand, Action<CredentialViewModel> cancelHandler, CredentialInfo credentialInfo = null)
132+
public CredentialViewModel(Action<CredentialViewModel> saveCommand, Action<CredentialViewModel> cancelHandler, bool isEdited = false, CredentialInfo credentialInfo = null)
133133
{
134134
_isLoading = true;
135135

136136
SaveCommand = new RelayCommand(p => saveCommand(this));
137137
CancelCommand = new RelayCommand(p => cancelHandler(this));
138138

139-
_isEdited = credentialInfo != null;
139+
_isEdited = isEdited;
140140

141141
_credentialInfo = credentialInfo ?? new CredentialInfo();
142142

Source/NETworkManager/ViewModels/CredentialsViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public async void Add()
358358
}, instance =>
359359
{
360360
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
361-
});
361+
}, false);
362362

363363
customDialog.Content = new CredentialDialog
364364
{
@@ -395,7 +395,7 @@ public async void Edit()
395395
}, instance =>
396396
{
397397
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
398-
}, SelectedCredential);
398+
},true, SelectedCredential);
399399

400400
customDialog.Content = new CredentialDialog
401401
{

Source/NETworkManager/ViewModels/DNSLookupHostViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Windows.Input;
55
using NETworkManager.Views;
66
using NETworkManager.Utilities;
7-
using NETworkManager.Models.Settings;
87

98
namespace NETworkManager.ViewModels
109
{

Source/NETworkManager/ViewModels/HTTPHeadersHostViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Windows.Input;
55
using NETworkManager.Views;
66
using NETworkManager.Utilities;
7-
using NETworkManager.Models.Settings;
87

98
namespace NETworkManager.ViewModels
109
{

Source/NETworkManager/ViewModels/IPScannerHostViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private async void EditProfileAction()
240240
}, instance =>
241241
{
242242
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
243-
}, ProfileManager.GetGroups(), SelectedProfile);
243+
}, ProfileManager.GetGroups(), true,SelectedProfile);
244244

245245
customDialog.Content = new ProfileDialog
246246
{
@@ -270,7 +270,7 @@ private async void CopyAsProfileAction()
270270
}, instance =>
271271
{
272272
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
273-
}, ProfileManager.GetGroups(), SelectedProfile);
273+
}, ProfileManager.GetGroups(), false, SelectedProfile);
274274

275275
customDialog.Content = new ProfileDialog
276276
{

Source/NETworkManager/ViewModels/NetworkInterfaceViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ private async void EditProfileAction()
865865
}, instance =>
866866
{
867867
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
868-
}, ProfileManager.GetGroups(), SelectedProfile);
868+
}, ProfileManager.GetGroups(), true, SelectedProfile);
869869

870870
customDialog.Content = new ProfileDialog
871871
{
@@ -895,7 +895,7 @@ private async void CopyAsProfileAction()
895895
}, instance =>
896896
{
897897
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
898-
}, ProfileManager.GetGroups(), SelectedProfile);
898+
}, ProfileManager.GetGroups(), false, SelectedProfile);
899899

900900
customDialog.Content = new ProfileDialog
901901
{

Source/NETworkManager/ViewModels/PingHostViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using System.Linq;
1212
using MahApps.Metro.Controls.Dialogs;
1313
using System.Windows;
14+
using NETworkManager.Converters;
1415

1516
namespace NETworkManager.ViewModels
1617
{
@@ -253,7 +254,7 @@ private async void EditProfileAction()
253254
}, instance =>
254255
{
255256
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
256-
}, ProfileManager.GetGroups(), SelectedProfile);
257+
}, ProfileManager.GetGroups(), true,SelectedProfile);
257258

258259
customDialog.Content = new ProfileDialog
259260
{
@@ -283,7 +284,7 @@ private async void CopyAsProfileAction()
283284
}, instance =>
284285
{
285286
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
286-
}, ProfileManager.GetGroups(), SelectedProfile);
287+
}, ProfileManager.GetGroups(), false,SelectedProfile);
287288

288289
customDialog.Content = new ProfileDialog
289290
{

Source/NETworkManager/ViewModels/PortScannerHostViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ private async void EditProfileAction()
250250
}, instance =>
251251
{
252252
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
253-
}, ProfileManager.GetGroups(), SelectedProfile);
253+
}, ProfileManager.GetGroups(), true,SelectedProfile);
254254

255255
customDialog.Content = new ProfileDialog
256256
{
@@ -280,7 +280,7 @@ private async void CopyAsProfileAction()
280280
}, instance =>
281281
{
282282
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
283-
}, ProfileManager.GetGroups(), SelectedProfile);
283+
}, ProfileManager.GetGroups(), false,SelectedProfile);
284284

285285
customDialog.Content = new ProfileDialog
286286
{

Source/NETworkManager/ViewModels/ProfileViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,14 +999,14 @@ public int WakeOnLAN_Port
999999
#endregion
10001000
#endregion
10011001

1002-
public ProfileViewModel(Action<ProfileViewModel> saveCommand, Action<ProfileViewModel> cancelHandler, IReadOnlyCollection<string> groups, ProfileInfo profileInfo = null)
1002+
public ProfileViewModel(Action<ProfileViewModel> saveCommand, Action<ProfileViewModel> cancelHandler, IReadOnlyCollection<string> groups, bool isEdited = false, ProfileInfo profileInfo = null)
10031003
{
10041004
_isLoading = true;
10051005

10061006
SaveCommand = new RelayCommand(p => saveCommand(this));
10071007
CancelCommand = new RelayCommand(p => cancelHandler(this));
10081008

1009-
IsEdited = profileInfo != null;
1009+
IsEdited = isEdited;
10101010

10111011
var profileInfo2 = profileInfo ?? new ProfileInfo();
10121012

Source/NETworkManager/ViewModels/ProfilesViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public async void AddProfile()
164164
}, instance =>
165165
{
166166
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
167-
}, ProfileManager.GetGroups());
167+
}, ProfileManager.GetGroups(), false);
168168

169169
customDialog.Content = new ProfileDialog
170170
{
@@ -189,7 +189,7 @@ public async void CopyAsProfile()
189189
}, instance =>
190190
{
191191
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
192-
}, ProfileManager.GetGroups(), SelectedProfile);
192+
}, ProfileManager.GetGroups(), false, SelectedProfile);
193193

194194
customDialog.Content = new ProfileDialog
195195
{
@@ -216,7 +216,7 @@ public async void EditProfile()
216216
}, instance =>
217217
{
218218
_dialogCoordinator.HideMetroDialogAsync(this, customDialog);
219-
}, ProfileManager.GetGroups(), SelectedProfile);
219+
}, ProfileManager.GetGroups(), true, SelectedProfile);
220220

221221
customDialog.Content = new ProfileDialog
222222
{

0 commit comments

Comments
 (0)