コード例 #1
0
 private void Shutdown(bool updating)
 {
     // Clear temporary files
     TemporaryFileServiceFactory.get().shutdown();
     try
     {
         RendezvousFactory.instance().quit();
     }
     catch (SystemException se)
     {
         Logger.warn("No Bonjour support available", se);
     }
     PreferencesFactory.get().setProperty("uses", PreferencesFactory.get().getInteger("uses") + 1);
     try
     {
         PreferencesFactory.get().save();
     }
     catch (UnauthorizedAccessException unauthorizedAccessException)
     {
         Logger.fatal("Could not save preferences", unauthorizedAccessException);
     }
     if (_updater != null && !updating)
     {
         _updater.unregister();
     }
 }
コード例 #2
0
ファイル: MainController.cs プロジェクト: wangkesen/cyberduck
 /// <summary>
 /// Default constructor.
 /// </summary>
 private MainController()
 {
     InitializeAppProperties();
     // Explicitly set SaveMySettingsOnExit to false, preventing UnauthorizedAccessException after Close
     // if no permission for writing to %AppData%
     SaveMySettingsOnExit = false;
     Startup             += ApplicationDidFinishLaunching;
     StartupNextInstance += StartupNextInstanceHandler;
     Shutdown            += delegate
     {
         // Clear temporary files
         TemporaryFileServiceFactory.get().shutdown();
         try
         {
             RendezvousFactory.instance().quit();
         }
         catch (SystemException se)
         {
             Logger.warn("No Bonjour support available", se);
         }
         PreferencesFactory.get().setProperty("uses", PreferencesFactory.get().getInteger("uses") + 1);
         try
         {
             PreferencesFactory.get().save();
         }
         catch (UnauthorizedAccessException unauthorizedAccessException)
         {
             Logger.fatal("Could not save preferences", unauthorizedAccessException);
         }
         if (_updater != null)
         {
             _updater.unregister();
         }
     };
 }