ACAT.Extensions.Default.WordPredictors.PresageWCF.Settings.Load C# (CSharp) Method

Load() public static method

Loads the settings from the settings file
public static Load ( ) : Settings
return Settings
        public static Settings Load()
        {
            Settings retVal = Load<Settings>(PreferencesFilePath);
            Save(retVal, PreferencesFilePath);
            return retVal;
        }

Usage Example

        /// <summary>
        /// Performs initialization.  Must be called first.
        /// Sets word prediction parameters and initializes Presage
        /// </summary>
        /// <returns>true on success</returns>
        public bool Init()
        {
            bool retVal = false;

            try
            {
                Attributions.Add("PRESAGE",
                                Resources.PresageAttribution);

                Settings.PreferencesFilePath = UserManager.GetFullPath(SettingsFileName);

                _presageSettings = Settings.Load();

                if (_presageSettings.StartPresageIfNotRunning)
                {
                    checkAndRunPresage();
                }

                retVal = initPresage();
                if (!retVal)
                {
                    // failure mostly means the presage config file has an
                    // incorrect database path.  Delete the config file so
                    // it will regenerate and then we can insert the correct
                    // database path when we init again
                    deletePresageConfigFile();
                    retVal = initPresage();
                }
            }
            catch (Exception ex)
            {
                Log.Debug("Error initializing Presage. " + ex);
            }

            return retVal;
        }
Settings