Пример #1
0
        /// <summary>
        /// Load configuration from persistence on startup of application
        /// </summary>
        /// <param name="programSettings"></param>
        /// <param name="settings"></param>
        /// <param name="themes"></param>
        public void LoadConfigOnAppStartup(Options programSettings,
                                           ISettingsManager settings,
                                           IThemesManager themes)
        {
            // Re/Load program options and user profile session data to control global behaviour of program
            settings.LoadOptions(this.mAppCore.DirFileAppSettingsData, themes, programSettings);
            settings.LoadSessionData(this.mAppCore.DirFileAppSessionData);

            settings.CheckSettingsOnLoad(SystemParameters.VirtualScreenLeft, SystemParameters.VirtualScreenTop);

            // Convert Session model into viewmodel instance
            var mruVM = ServiceLocator.Current.GetInstance <IMRUListViewModel>();

            MRUEntrySerializer.ConvertToViewModel(settings.SessionData.MruList, mruVM);

            // Initialize skinning engine with this current skin
            // standard skins defined in class enum
            // plus configured skins with highlighting
            themes.SetSelectedTheme(settings.SettingData.CurrentTheme);
            this.ResetTheme();                       // Initialize theme in process
        }
Пример #2
0
        /// <summary>
        /// Load configuration from persistence on startup of application
        /// </summary>
        /// <param name="programSettings"></param>
        /// <param name="settings"></param>
        /// <param name="themes"></param>
        public async Task <IOptions> LoadConfigOnAppStartupAsync(IOptions programSettings,
                                                                 ISettingsManager settings,
                                                                 IThemesManager themes)
        {
            // Re/Load program options and user profile session data to control global behaviour of program
            await settings.LoadOptionsAsync(_AppCore.DirFileAppSettingsData, themes, programSettings);

            settings.LoadSessionData(_AppCore.DirFileAppSessionData);

            settings.CheckSettingsOnLoad(SystemParameters.VirtualScreenLeft, SystemParameters.VirtualScreenTop);

            // Initialize skinning engine with this current skin
            // standard skins defined in class enum PLUS
            // configured skins with highlighting
            themes.SetSelectedTheme(settings.SettingData.CurrentTheme);
            ResetTheme();                       // Initialize theme in process

            // Convert Session model into viewmodel instance
            MRUEntrySerializer.ConvertToViewModel(settings.SessionData.MruList, _MruVM);

            return(programSettings);
        }