@@ -19,18 +19,18 @@ namespace Edge
1919{
2020 public sealed partial class ImageViewer : Page
2121 {
22- public FileInfo fileInfo ;
22+ public FileInfo info ;
2323 public BitmapImage source ;
2424
2525 private PrintManager printManager ;
2626 private PrintDocument printDocument ;
2727 private IPrintDocumentSource printDocumentSource ;
2828
29- public ImageViewer ( string filepath )
29+ public ImageViewer ( FileInfo fileInfo )
3030 {
3131 this . InitializeComponent ( ) ;
32- fileInfo = new ( filepath ) ;
33- source = new ( new Uri ( filepath ) ) ;
32+ info = fileInfo ;
33+ source = new ( new Uri ( info . FullName ) ) ;
3434 image . Source = source ;
3535 source . ImageOpened += ImageOpened ;
3636 }
@@ -66,7 +66,7 @@ private void PrintDocument_Paginate(object sender, PaginateEventArgs e)
6666
6767 private void PrintManager_PrintTaskRequested ( PrintManager sender , PrintTaskRequestedEventArgs args )
6868 {
69- PrintTask task = args . Request . CreatePrintTask ( fileInfo . Name , PrintTaskSourceRequested ) ;
69+ PrintTask task = args . Request . CreatePrintTask ( info . Name , PrintTaskSourceRequested ) ;
7070 }
7171
7272 private void PrintTaskSourceRequested ( PrintTaskSourceRequestedArgs args )
@@ -86,17 +86,17 @@ private async void PrintImageRequest(object sender, RoutedEventArgs e)
8686
8787 private void ImageOpened ( object sender , RoutedEventArgs e )
8888 {
89- imageNameBlock . Text = fileInfo . Name ;
89+ imageNameBlock . Text = info . Name ;
9090 imagePixel . Text = $ "{ source . PixelWidth } x { source . PixelHeight } ";
91- imageSize . Text = Converters . ToFileSizeString ( fileInfo . Length ) ;
91+ imageSize . Text = Converters . ToFileSizeString ( info . Length ) ;
9292 }
9393
9494 private async void ImageDeleteRequest ( object sender , RoutedEventArgs e )
9595 {
9696 ContentDialogResult result = await deleteDialog . ShowAsync ( ) ;
9797 if ( result == ContentDialogResult . Primary )
9898 {
99- fileInfo . Delete ( ) ;
99+ info . Delete ( ) ;
100100 }
101101 }
102102
@@ -109,7 +109,7 @@ private void ImageRotateRequest(object sender, RoutedEventArgs e)
109109
110110 private void OpenFileLocation ( object sender , RoutedEventArgs e )
111111 {
112- System . Diagnostics . Process . Start ( "explorer.exe" , $ "/select,\" { fileInfo . FullName } \" ") ;
112+ System . Diagnostics . Process . Start ( "explorer.exe" , $ "/select,\" { info . FullName } \" ") ;
113113 }
114114
115115 private void Image_PointerWheelChanged ( object sender , PointerRoutedEventArgs e )
@@ -141,17 +141,17 @@ private void ImageFullScreen(object sender, RoutedEventArgs e)
141141
142142 private void SaveImageAs ( object sender , RoutedEventArgs e )
143143 {
144- string path = Utilities . Win32SaveFile ( fileInfo . FullName , this . GetWindowHandle ( ) ) ;
144+ string path = Utilities . Win32SaveFile ( info . FullName , this . GetWindowHandle ( ) ) ;
145145 if ( path != string . Empty )
146146 {
147- fileInfo . CopyTo ( path , true ) ;
147+ info . CopyTo ( path , true ) ;
148148 }
149149 }
150150
151151 private void CopyFilePath ( object sender , RoutedEventArgs e )
152152 {
153153 DataPackage package = new ( ) ;
154- package . SetText ( fileInfo . FullName ) ;
154+ package . SetText ( info . FullName ) ;
155155 Clipboard . SetContent ( package ) ;
156156 }
157157
@@ -160,7 +160,7 @@ private async void SetImageAsLockScreen(object sender, RoutedEventArgs e)
160160 if ( UserProfilePersonalizationSettings . IsSupported ( ) )
161161 {
162162 UserProfilePersonalizationSettings settings = UserProfilePersonalizationSettings . Current ;
163- StorageFile imageFile = await StorageFile . GetFileFromPathAsync ( fileInfo . FullName ) ;
163+ StorageFile imageFile = await StorageFile . GetFileFromPathAsync ( info . FullName ) ;
164164 await settings . TrySetLockScreenImageAsync ( imageFile ) ;
165165 }
166166 }
@@ -170,7 +170,7 @@ private async void SetImageAsWallpaper(object sender, RoutedEventArgs e)
170170 if ( UserProfilePersonalizationSettings . IsSupported ( ) )
171171 {
172172 UserProfilePersonalizationSettings settings = UserProfilePersonalizationSettings . Current ;
173- StorageFile imageFile = await StorageFile . GetFileFromPathAsync ( fileInfo . FullName ) ;
173+ StorageFile imageFile = await StorageFile . GetFileFromPathAsync ( info . FullName ) ;
174174 await settings . TrySetWallpaperImageAsync ( imageFile ) ;
175175 }
176176 }
0 commit comments