1- using MahApps . Metro . Controls . Dialogs ;
1+ using MahApps . Metro . SimpleChildWindow ;
22using NETworkManager . Localization . Resources ;
33using NETworkManager . Models ;
44using NETworkManager . Models . Network ;
99using NETworkManager . Views ;
1010using System ;
1111using System . Collections . Generic ;
12- using System . Configuration ;
13- using System . Diagnostics ;
1412using System . Security ;
1513using System . Threading . Tasks ;
1614using System . Windows ;
17- using MahApps . Metro . SimpleChildWindow ;
1815
1916namespace NETworkManager ;
2017
@@ -496,9 +493,9 @@ public static Task ShowAddProfileDialog(Window parentWindow, IProfileManagerMini
496493 childWindow . DataContext = childWindowViewModel ;
497494
498495 viewModel . OnProfileManagerDialogOpen ( ) ;
499-
496+
500497 Settings . ConfigurationManager . Current . IsChildWindowOpen = true ;
501-
498+
502499 return parentWindow . ShowChildWindowAsync ( childWindow ) ;
503500 }
504501
@@ -528,9 +525,9 @@ public static Task ShowEditProfileDialog(Window parentWindow, IProfileManagerMin
528525 childWindow . DataContext = childWindowViewModel ;
529526
530527 viewModel . OnProfileManagerDialogOpen ( ) ;
531-
528+
532529 Settings . ConfigurationManager . Current . IsChildWindowOpen = true ;
533-
530+
534531 return parentWindow . ShowChildWindowAsync ( childWindow ) ;
535532 }
536533
@@ -543,24 +540,24 @@ public static Task ShowCopyAsProfileDialog(Window parentWindow, IProfileManagerM
543540 {
544541 childWindow . IsOpen = false ;
545542 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
546-
543+
547544 viewModel . OnProfileManagerDialogClose ( ) ;
548545
549546 ProfileManager . AddProfile ( ParseProfileInfo ( instance ) ) ;
550547 } , _ =>
551548 {
552549 childWindow . IsOpen = false ;
553550 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
554-
551+
555552 viewModel . OnProfileManagerDialogClose ( ) ;
556553 } , ProfileManager . GetGroupNames ( ) , profile . Group , ProfileEditMode . Copy , profile ) ;
557554
558555 childWindow . Title = Strings . CopyProfile ;
559-
556+
560557 childWindow . DataContext = childWindowViewModel ;
561-
558+
562559 viewModel . OnProfileManagerDialogOpen ( ) ;
563-
560+
564561 Settings . ConfigurationManager . Current . IsChildWindowOpen = true ;
565562
566563 return parentWindow . ShowChildWindowAsync ( childWindow ) ;
@@ -570,32 +567,32 @@ public static Task ShowDeleteProfileDialog(Window parentWindow, IProfileManagerM
570567 IList < ProfileInfo > profiles )
571568 {
572569 var childWindow = new OKCancelInfoMessageChildWindow ( ) ;
573-
570+
574571 OKCancelInfoMessageViewModel childWindowViewModel = new ( _ =>
575572 {
576573 childWindow . IsOpen = false ;
577574 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
578-
575+
579576 viewModel . OnProfileManagerDialogClose ( ) ;
580577
581578 ProfileManager . RemoveProfiles ( profiles ) ;
582579 } , _ =>
583580 {
584581 childWindow . IsOpen = false ;
585582 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
586-
583+
587584 viewModel . OnProfileManagerDialogClose ( ) ;
588585 } ,
589586 profiles . Count == 1
590587 ? Strings . DeleteProfileMessage
591588 : Strings . DeleteProfilesMessage ) ;
592589
593590 childWindow . Title = Strings . DeleteProfile ;
594-
591+
595592 childWindow . DataContext = childWindowViewModel ;
596593
597594 viewModel . OnProfileManagerDialogOpen ( ) ;
598-
595+
599596 Settings . ConfigurationManager . Current . IsChildWindowOpen = true ;
600597
601598 return parentWindow . ShowChildWindowAsync ( childWindow ) ;
@@ -608,95 +605,95 @@ public static Task ShowDeleteProfileDialog(Window parentWindow, IProfileManagerM
608605 public static Task ShowAddGroupDialog ( Window parentWindow , IProfileManagerMinimal viewModel )
609606 {
610607 var childWindow = new GroupChildWindow ( parentWindow ) ;
611-
608+
612609 GroupViewModel childWindowViewModel = new ( instance =>
613610 {
614611 childWindow . IsOpen = false ;
615612 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
616-
613+
617614 viewModel . OnProfileManagerDialogClose ( ) ;
618-
615+
619616 ProfileManager . AddGroup ( ParseGroupInfo ( instance ) ) ;
620617 } , _ =>
621618 {
622619 childWindow . IsOpen = false ;
623620 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
624-
621+
625622 viewModel . OnProfileManagerDialogClose ( ) ;
626623 } , ProfileManager . GetGroupNames ( ) ) ;
627-
624+
628625 childWindow . Title = Strings . AddGroup ;
629-
626+
630627 childWindow . DataContext = childWindowViewModel ;
631-
628+
632629 viewModel . OnProfileManagerDialogOpen ( ) ;
633-
630+
634631 Settings . ConfigurationManager . Current . IsChildWindowOpen = true ;
635-
632+
636633 return parentWindow . ShowChildWindowAsync ( childWindow ) ;
637634 }
638635
639636 public static Task ShowEditGroupDialog ( Window parentWindow , IProfileManagerMinimal viewModel ,
640637 GroupInfo group )
641638 {
642639 var childWindow = new GroupChildWindow ( parentWindow ) ;
643-
640+
644641 GroupViewModel childWindowViewModel = new ( instance =>
645642 {
646643 childWindow . IsOpen = false ;
647644 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
648-
645+
649646 viewModel . OnProfileManagerDialogClose ( ) ;
650-
647+
651648 ProfileManager . ReplaceGroup ( group , ParseGroupInfo ( instance ) ) ;
652649 } , _ =>
653650 {
654651 childWindow . IsOpen = false ;
655652 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
656-
653+
657654 viewModel . OnProfileManagerDialogClose ( ) ;
658655 } , ProfileManager . GetGroupNames ( ) , GroupEditMode . Edit , group ) ;
659-
656+
660657 childWindow . Title = Strings . EditGroup ;
661-
658+
662659 childWindow . DataContext = childWindowViewModel ;
663-
660+
664661 viewModel . OnProfileManagerDialogOpen ( ) ;
665-
662+
666663 Settings . ConfigurationManager . Current . IsChildWindowOpen = true ;
667-
664+
668665 return parentWindow . ShowChildWindowAsync ( childWindow ) ;
669666 }
670667
671668 public static Task ShowDeleteGroupDialog ( Window parentWindow , IProfileManagerMinimal viewModel ,
672669 GroupInfo group )
673670 {
674671 var childWindow = new OKCancelInfoMessageChildWindow ( ) ;
675-
672+
676673 OKCancelInfoMessageViewModel childWindowViewModel = new ( _ =>
677674 {
678675 childWindow . IsOpen = false ;
679676 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
680-
677+
681678 viewModel . OnProfileManagerDialogClose ( ) ;
682679
683680 ProfileManager . RemoveGroup ( group ) ;
684681 } , _ =>
685682 {
686683 childWindow . IsOpen = false ;
687684 Settings . ConfigurationManager . Current . IsChildWindowOpen = false ;
688-
685+
689686 viewModel . OnProfileManagerDialogClose ( ) ;
690687 } , Strings . DeleteGroupMessage ) ;
691-
688+
692689 childWindow . Title = Strings . DeleteGroup ;
693-
690+
694691 childWindow . DataContext = childWindowViewModel ;
695-
692+
696693 viewModel . OnProfileManagerDialogOpen ( ) ;
697-
694+
698695 Settings . ConfigurationManager . Current . IsChildWindowOpen = true ;
699-
696+
700697 return parentWindow . ShowChildWindowAsync ( childWindow ) ;
701698 }
702699
0 commit comments