示例#1
0
        public override void Initialize()
        {
            Settings = SettingsVM.Load();
            if (Settings == null)
            {
                Settings = new SettingsVM();
            }
            else
            {
                Settings.IsPropertiesInitialized = true;
            }

            try
            {
                if (File.Exists(_logFilePath))
                {
                    Log = File.ReadAllText(_logFilePath);
                }
            }
            catch (Exception ex)
            {
                AddToLog(string.Format("Getting file: {0}, Error: {1}", _logFilePath, ex.Message));
            }

            Settings.Initialize();
            base.Initialize();
        }
示例#2
0
 public static SettingsVM Load()
 {
     if (File.Exists(SettingsVM._settingsFilePath))
     {
         return(SettingsVM.loadXmlFileAsync <SettingsVM>(SettingsVM._settingsFilePath));
     }
     else
     {
         return(null);
     }
 }
示例#3
0
 public MainVM()
 {
     _settings = new SettingsVM();
     Instance  = this;
 }