예제 #1
0
        public static void LoadSettings()
        {
            _settingsObject = new SettingsObject();
            string fileName = SettingsFileName;

            if (File.Exists(fileName))
            {
                var serializer = new XmlSerializer(_settingsObject.GetType());
                var reader     = new XmlTextReader(fileName);
                try
                {
                    _settingsObject = serializer.Deserialize(reader) as SettingsObject;
                }
                finally
                {
                    reader.Close();
                }
            }
        }
예제 #2
0
 public static void LoadSettings()
 {
     _settingsObject = new SettingsObject();
     string fileName = SettingsFileName;
     if (File.Exists(fileName))
     {
         var serializer = new XmlSerializer(_settingsObject.GetType());
         var reader = new XmlTextReader(fileName);
         try
         {
             _settingsObject = serializer.Deserialize(reader) as SettingsObject;
         }
         finally
         {
             reader.Close();
         }
     }
     if (DefaultRecordLimit == 0)
         DefaultRecordLimit = 100;
 }