@@ -647,200 +647,88 @@ public static void UpdateCardStrings(StatusCenterItem card)
647
647
{
648
648
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
649
649
: card . HeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , destinationDirName ) ;
650
- card . Header = card . FileSystemOperationReturnResult switch
651
- {
652
- ReturnResult . Cancelled => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
653
- ReturnResult . Success => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
654
- ReturnResult . Failed => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
655
- ReturnResult . InProgress => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
656
- _ => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
657
- } ;
650
+ card . Header = headerString ;
658
651
659
652
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
660
653
: card . SubHeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourcePath , destinationPath ) ;
661
- card . SubHeader = card . FileSystemOperationReturnResult switch
662
- {
663
- ReturnResult . Cancelled => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
664
- ReturnResult . Success => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
665
- ReturnResult . Failed => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
666
- ReturnResult . InProgress => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
667
- _ => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
668
- } ;
654
+ card . SubHeader = subHeaderString ;
669
655
break ;
670
656
}
671
657
case FileOperationType . Move :
672
658
{
673
659
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
674
660
: card . HeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , destinationDirName ) ;
675
- card . Header = card . FileSystemOperationReturnResult switch
676
- {
677
- ReturnResult . Cancelled => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
678
- ReturnResult . Success => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
679
- ReturnResult . Failed => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
680
- ReturnResult . InProgress => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
681
- _ => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
682
- } ;
661
+ card . Header = headerString ;
683
662
684
663
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
685
664
: card . SubHeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourcePath , destinationPath ) ;
686
- card . SubHeader = card . FileSystemOperationReturnResult switch
687
- {
688
- ReturnResult . Cancelled => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
689
- ReturnResult . Success => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
690
- ReturnResult . Failed => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
691
- ReturnResult . InProgress => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
692
- _ => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
693
- } ;
665
+ card . SubHeader = subHeaderString ;
694
666
break ;
695
667
}
696
668
case FileOperationType . Delete :
697
669
{
698
670
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
699
671
: card . HeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourceDirName ) ;
700
- card . Header = card . FileSystemOperationReturnResult switch
701
- {
702
- ReturnResult . Cancelled => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
703
- ReturnResult . Success => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
704
- ReturnResult . Failed => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
705
- ReturnResult . InProgress => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
706
- _ => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
707
- } ;
672
+ card . Header = headerString ;
708
673
709
674
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
710
675
: card . SubHeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourcePath ) ;
711
- card . SubHeader = card . FileSystemOperationReturnResult switch
712
- {
713
- ReturnResult . Cancelled => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
714
- ReturnResult . Success => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
715
- ReturnResult . Failed => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
716
- ReturnResult . InProgress => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
717
- _ => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
718
- } ;
676
+ card . SubHeader = subHeaderString ;
719
677
break ;
720
678
}
721
679
case FileOperationType . Recycle :
722
680
{
723
681
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
724
682
: card . HeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourceDirName ) ;
725
- card . Header = card . FileSystemOperationReturnResult switch
726
- {
727
- ReturnResult . Cancelled => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
728
- ReturnResult . Success => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
729
- ReturnResult . Failed => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
730
- ReturnResult . InProgress => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
731
- _ => string . Format ( headerString , card . TotalItemsCount , sourceDirName ) ,
732
- } ;
683
+ card . Header = headerString ;
733
684
734
685
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
735
686
: card . SubHeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourcePath ) ;
736
- card . SubHeader = card . FileSystemOperationReturnResult switch
737
- {
738
- ReturnResult . Cancelled => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
739
- ReturnResult . Success => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
740
- ReturnResult . Failed => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
741
- ReturnResult . InProgress => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
742
- _ => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
743
- } ;
687
+ card . SubHeader = subHeaderString ;
744
688
break ;
745
689
}
746
690
case FileOperationType . Extract :
747
691
{
748
692
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
749
693
: card . HeaderStringResource . GetLocalizedFormatResource ( sourceFileName , destinationDirName ) ;
750
- card . Header = card . FileSystemOperationReturnResult switch
751
- {
752
- ReturnResult . Cancelled => string . Format ( headerString , sourceFileName , destinationDirName ) ,
753
- ReturnResult . Success => string . Format ( headerString , sourceFileName , destinationDirName ) ,
754
- ReturnResult . Failed => string . Format ( headerString , sourceFileName , destinationDirName ) ,
755
- ReturnResult . InProgress => string . Format ( headerString , sourceFileName , destinationDirName ) ,
756
- _ => string . Format ( headerString , sourceFileName , destinationDirName ) ,
757
- } ;
694
+ card . Header = headerString ;
758
695
759
696
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
760
697
: card . SubHeaderStringResource . GetLocalizedFormatResource ( sourceFileName , sourcePath , destinationPath ) ;
761
- card . SubHeader = card . FileSystemOperationReturnResult switch
762
- {
763
- ReturnResult . Cancelled => string . Format ( subHeaderString , sourceFileName , sourcePath , destinationPath ) ,
764
- ReturnResult . Success => string . Format ( subHeaderString , sourceFileName , sourcePath , destinationPath ) ,
765
- ReturnResult . Failed => string . Format ( subHeaderString , sourceFileName , sourcePath , destinationPath ) ,
766
- ReturnResult . InProgress => string . Format ( subHeaderString , sourceFileName , sourcePath , destinationPath ) ,
767
- _ => string . Format ( subHeaderString , sourceFileName , sourcePath , destinationPath ) ,
768
- } ;
698
+ card . SubHeader = subHeaderString ;
769
699
break ;
770
700
}
771
701
case FileOperationType . Compressed :
772
702
{
773
703
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
774
704
: card . HeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , destinationDirName ) ;
775
- card . Header = card . FileSystemOperationReturnResult switch
776
- {
777
- ReturnResult . Cancelled => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
778
- ReturnResult . Success => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
779
- ReturnResult . Failed => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
780
- ReturnResult . InProgress => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
781
- _ => string . Format ( headerString , card . TotalItemsCount , destinationDirName ) ,
782
- } ;
705
+ card . Header = headerString ;
783
706
784
707
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
785
708
: card . SubHeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourcePath , destinationPath ) ;
786
- card . SubHeader = card . FileSystemOperationReturnResult switch
787
- {
788
- ReturnResult . Cancelled => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
789
- ReturnResult . Success => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
790
- ReturnResult . Failed => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
791
- ReturnResult . InProgress => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
792
- _ => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
793
- } ;
709
+ card . SubHeader = subHeaderString ;
794
710
break ;
795
711
}
796
712
case FileOperationType . GitClone :
797
713
{
798
714
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
799
715
: card . HeaderStringResource . GetLocalizedFormatResource ( sourcePath , destinationDirName ) ;
800
- card . Header = card . FileSystemOperationReturnResult switch
801
- {
802
- ReturnResult . Cancelled => string . Format ( headerString , sourcePath , destinationDirName ) ,
803
- ReturnResult . Success => string . Format ( headerString , sourcePath , destinationDirName ) ,
804
- ReturnResult . Failed => string . Format ( headerString , sourcePath , destinationDirName ) ,
805
- ReturnResult . InProgress => string . Format ( headerString , sourcePath , destinationDirName ) ,
806
- _ => string . Format ( headerString , sourcePath , destinationDirName ) ,
807
- } ;
716
+ card . Header = headerString ;
808
717
809
718
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
810
719
: card . SubHeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourcePath , destinationPath ) ;
811
- card . SubHeader = card . FileSystemOperationReturnResult switch
812
- {
813
- ReturnResult . Cancelled => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
814
- ReturnResult . Success => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
815
- ReturnResult . Failed => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
816
- ReturnResult . InProgress => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
817
- _ => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath , destinationPath ) ,
818
- } ;
720
+ card . SubHeader = subHeaderString ;
819
721
break ;
820
722
}
821
723
case FileOperationType . InstallFont :
822
724
{
823
725
string headerString = string . IsNullOrWhiteSpace ( card . HeaderStringResource ) ? string . Empty
824
726
: card . HeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount ) ;
825
- card . Header = card . FileSystemOperationReturnResult switch
826
- {
827
- ReturnResult . Cancelled => string . Format ( headerString , card . TotalItemsCount ) ,
828
- ReturnResult . Success => string . Format ( headerString , card . TotalItemsCount ) ,
829
- ReturnResult . Failed => string . Format ( headerString , card . TotalItemsCount ) ,
830
- ReturnResult . InProgress => string . Format ( headerString , card . TotalItemsCount ) ,
831
- _ => string . Format ( headerString , card . TotalItemsCount ) ,
832
- } ;
727
+ card . Header = headerString ;
833
728
834
729
string subHeaderString = string . IsNullOrWhiteSpace ( card . SubHeaderStringResource ) ? string . Empty
835
730
: card . SubHeaderStringResource . GetLocalizedFormatResource ( card . TotalItemsCount , sourcePath ) ;
836
- card . SubHeader = card . FileSystemOperationReturnResult switch
837
- {
838
- ReturnResult . Cancelled => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
839
- ReturnResult . Success => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
840
- ReturnResult . Failed => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
841
- ReturnResult . InProgress => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
842
- _ => string . Format ( subHeaderString , card . TotalItemsCount , sourcePath ) ,
843
- } ;
731
+ card . SubHeader = subHeaderString ;
844
732
break ;
845
733
}
846
734
}
0 commit comments