File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,20 @@ internal set
87
87
else
88
88
{
89
89
SelectedItemsPropertiesViewModel . SelectedItemsCount = SelectedItems . Count . ToString ( ) + " " + ResourceController . GetTranslation ( "ItemsSelected/Text" ) ;
90
- SelectedItemsPropertiesViewModel . ItemsSize = "" ; // We need to loop through the items to get the size
90
+
91
+ if ( SelectedItems . All ( x => x . PrimaryItemAttribute == StorageItemTypes . File ) )
92
+ {
93
+ long size = 0 ;
94
+ foreach ( var item in SelectedItems )
95
+ {
96
+ size += item . FileSizeBytes ;
97
+ }
98
+ SelectedItemsPropertiesViewModel . ItemsSize = ByteSizeLib . ByteSize . FromBytes ( size ) . ToBinaryString ( ) . ConvertSizeAbbreviation ( ) ;
99
+ }
100
+ else
101
+ {
102
+ SelectedItemsPropertiesViewModel . ItemsSize = string . Empty ;
103
+ }
91
104
}
92
105
}
93
106
NotifyPropertyChanged ( "SelectedItems" ) ;
You can’t perform that action at this time.
0 commit comments