コード例 #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;
 }