예제 #1
0
 public static void PauseConfigObserving()
 {
     try
     {
         fileWatcher.StopObservation();
     }
     catch (Exception exception)
     {
         Log.Error("Unable to pause configuration file observation.", exception);
     }
 }
예제 #2
0
        public static void Save()
        {
            if (Main.Settings.Settings.CredentialStore != Terminals.Configuration.Files.Main.CredentialStoreType.Xml)
            {
                return;
            }

            try
            {
                fileLock.WaitOne();
                fileWatcher.StopObservation();
                Serialize.SerializeXmlToDisk(cache, configFileLocation);
            }
            catch (Exception exception)
            {
                string errorMessage = string.Format("Save credentials to {0} failed.", configFileLocation);
                Log.Error(errorMessage, exception);
            }
            finally
            {
                fileWatcher.StartObservation();
                fileLock.ReleaseMutex();
            }
        }