Ejemplo n.º 1
0
        private bool DeserializeAppSettingsModel(string settingsPath)
        {
            FileInfo settingsFile = new FileInfo(settingsPath);

            if (!settingsFile.Exists)
            {
                return(false);
            }
            StreamReader sr = null;

            try
            {
                using (sr = new StreamReader(settingsPath))
                {
                    model = serializer.Deserialize(sr) as AppSettingsModel;
                }
            }
            finally
            {
                if (sr != null)
                {
                    sr.Close();
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
 private AppSettings()
 {
     model      = new AppSettingsModel();
     serializer = new XmlSerializer(typeof(AppSettingsModel));
     isLoaded   = false;
 }