23
23
using Windows . ApplicationModel ;
24
24
using Windows . ApplicationModel . Activation ;
25
25
using Windows . ApplicationModel . AppService ;
26
+ using Windows . ApplicationModel . Core ;
27
+ using Windows . Foundation . Metadata ;
26
28
using Windows . Storage ;
27
29
using Windows . UI . Core ;
28
30
using Windows . UI . Notifications ;
@@ -71,8 +73,8 @@ public App()
71
73
Suspending += OnSuspending ;
72
74
LeavingBackground += OnLeavingBackground ;
73
75
// Initialize NLog
74
- Windows . Storage . StorageFolder storageFolder = Windows . Storage . ApplicationData . Current . LocalFolder ;
75
- NLog . LogManager . Configuration . Variables [ "LogPath" ] = storageFolder . Path ;
76
+ StorageFolder storageFolder = ApplicationData . Current . LocalFolder ;
77
+ LogManager . Configuration . Variables [ "LogPath" ] = storageFolder . Path ;
76
78
77
79
StartAppCenter ( ) ;
78
80
}
@@ -86,7 +88,7 @@ private async void StartAppCenter()
86
88
var lines = await FileIO . ReadTextAsync ( file ) ;
87
89
obj = JObject . Parse ( lines ) ;
88
90
}
89
- catch ( Exception e )
91
+ catch
90
92
{
91
93
return ;
92
94
}
@@ -142,7 +144,7 @@ private async void Connection_RequestReceived(AppServiceConnection sender, AppSe
142
144
var changeType = ( string ) args . Request . Message [ "Type" ] ;
143
145
var newItem = JsonConvert . DeserializeObject < ShellFileItem > ( args . Request . Message . Get ( "Item" , "" ) ) ;
144
146
Debug . WriteLine ( "{0}: {1}" , folderPath , changeType ) ;
145
- await Windows . ApplicationModel . Core . CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal , ( ) =>
147
+ await CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal , ( ) =>
146
148
{
147
149
// If we are currently displaying the reycle bin lets refresh the items
148
150
if ( CurrentInstance . FilesystemViewModel ? . CurrentFolder ? . ItemPath == folderPath )
@@ -186,7 +188,7 @@ private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
186
188
187
189
public static void UnpinItem_Click ( object sender , RoutedEventArgs e )
188
190
{
189
- if ( rightClickedItem . Path . Equals ( App . AppSettings . RecycleBinPath , StringComparison . OrdinalIgnoreCase ) )
191
+ if ( rightClickedItem . Path . Equals ( AppSettings . RecycleBinPath , StringComparison . OrdinalIgnoreCase ) )
190
192
{
191
193
AppSettings . PinRecycleBinToSideBar = false ;
192
194
}
@@ -212,7 +214,7 @@ protected override async void OnLaunched(LaunchActivatedEventArgs e)
212
214
213
215
Logger . Info ( "App launched" ) ;
214
216
215
- bool canEnablePrelaunch = Windows . Foundation . Metadata . ApiInformation . IsMethodPresent ( "Windows.ApplicationModel.Core.CoreApplication" , "EnablePrelaunch" ) ;
217
+ bool canEnablePrelaunch = ApiInformation . IsMethodPresent ( "Windows.ApplicationModel.Core.CoreApplication" , "EnablePrelaunch" ) ;
216
218
217
219
// Do not repeat app initialization when the Window already has content,
218
220
// just ensure that the window is active
@@ -272,7 +274,7 @@ private void CoreWindow_Activated(CoreWindow sender, WindowActivatedEventArgs ar
272
274
273
275
private void Window_BackRequested ( object sender , BackRequestedEventArgs e )
274
276
{
275
- if ( App . CurrentInstance . ContentFrame . CanGoBack )
277
+ if ( CurrentInstance . ContentFrame . CanGoBack )
276
278
{
277
279
e . Handled = true ;
278
280
NavigationActions . Back_Click ( null , null ) ;
@@ -404,7 +406,7 @@ protected override async void OnActivated(IActivatedEventArgs args)
404
406
405
407
private void TryEnablePrelaunch ( )
406
408
{
407
- Windows . ApplicationModel . Core . CoreApplication . EnablePrelaunch ( true ) ;
409
+ CoreApplication . EnablePrelaunch ( true ) ;
408
410
}
409
411
410
412
/// <summary>
0 commit comments