Пример #1
0
 public void Save()
 {
     try
     {
         lock (m_SyncRoot)
         {
             TextSettingsFileWriter serializer = new TextSettingsFileWriter(m_Filename);
             serializer.Serialize(m_SectionCache);
         }
     }
     catch (Exception e)
     {
         Tracer.Error(e);
     }
 }
Пример #2
0
        private bool LoadFromFile(string fileName)
        {
            if (!File.Exists(fileName))
            {
                return(false);
            }

            try
            {
                TextSettingsFileWriter serializer = new TextSettingsFileWriter(fileName);
                serializer.Deserialize(m_SectionCache);
                return(true);
            }
            catch (Exception e)
            {
                Tracer.Error(e);
                return(false);
            }
        }