Beispiel #1
0
 public static void TriggerOnSettingsChanged(SettingsSave config)
 {
     if (OnSettingsChanged != null)
     {
         OnSettingsChanged(config);
     }
 }
Beispiel #2
0
 private void OnsettingsChanged(SettingsSave config)
 {
     if (bindings != config.controls.keyBindings)
     {
         bindings = config.controls.keyBindings;
     }
 }
Beispiel #3
0
 //method to save def event
 public void SaveDefaultEvent(string projectID, string clientID, string secret, string account)
 {
     SettingsSave.SetSetting("clientID", clientID);
     SettingsSave.SetSetting("secret", secret);
     SettingsSave.SetSetting("projectID", projectID);
     SettingsSave.SetSetting("account", account);
 }
Beispiel #4
0
 public void Start()
 {
     saveInfo = FindObjectOfType <SettingsSave>();
     if (saveInfo)
     {
         SwitchSave(saveInfo.saveFile);
     }
     time_per_character = 60 / 5 / WPM;
 }
        public RevitHostSettings(SettingsSave _settings)
        {
            this._hostPanel_ID = _settings.HostPanel_ID;
            this._Disciplines = new Dictionary<string, string>();

            foreach(Discipline d in _settings.Disciplines)
            {
                _Disciplines.Add(d.Name, d.Path);
            }
        }
Beispiel #6
0
    public static void SaveSettings(SettingsSave settings_)
    {
        SettingsSave settings = new SettingsSave();

        settings = settings_;

        string settingsOut = JsonUtility.ToJson(settings);

        File.WriteAllText(SaveDirectory + "/saveSettings.txt", settingsOut);

        Debug.Log("Settings saved in " + SaveDirectory);
    }
Beispiel #7
0
    /// <summary>
    /// Saves changes made to settings keys into the database.
    /// </summary>
    public void SaveChanges()
    {
        // Validate values
        var isValid = IsValid();

        if (!isValid)
        {
            ShowError(GetString("general.saveerror"));
            return;
        }

        bool logSynchronization = (mSettingsCategoryInfo.CategoryName.ToLowerCSafe() != "cms.staging");

        using (var h = SettingsSave.StartEvent())
        {
            if (h.CanContinue())
            {
                // Update changes in database and hashtables
                foreach (SettingsKeyItem tmpItem in mKeyItems)
                {
                    // Save only changed settings
                    if (!tmpItem.KeyChanged)
                    {
                        continue;
                    }

                    string keyName = tmpItem.KeyName;

                    object keyValue = tmpItem.KeyValue;
                    if (tmpItem.KeyIsInherited)
                    {
                        keyValue = DBNull.Value;
                    }

                    if (keyName.EqualsCSafe("CMSDBObjectOwner", true))
                    {
                        logSynchronization = false;
                    }

                    SettingsKeyInfoProvider.SetValue(keyName, SiteName, keyValue, logSynchronization);

                    ClearCache(keyName, keyValue);
                }

                // Show message
                ShowChangesSaved();
            }

            h.FinishEvent();
        }
    }
Beispiel #8
0
    void Awake()
    {
        //if config file exists load else create new default configs file
        SettingsSave loadedConfig = SaveSystem.Load("config", SaveType.set) as SettingsSave;

        if (loadedConfig != null)
        {
            config = loadedConfig;
        }
        else
        {
            config = new SettingsSave();
            SaveSystem.Save(config, "config", SaveType.set);
        }
        LoadSettings();
    }
Beispiel #9
0
 public void CustomJson()
 {
     if (SettingsSave.GetSetting("clientID").Length == 0 || SettingsSave.GetSetting("secret").Length == 0 || SettingsSave.GetSetting("projectID").Length == 0 || SettingsSave.GetSetting("account").Length == 0)
     {
         //message box
     }
     else
     {
         if (File.Exists(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\credentials.json") == false) //json exist
         {
             MyEvent.CreateJSon(SettingsSave.GetSetting("clientID"), SettingsSave.GetSetting("projectID"), SettingsSave.GetSetting("secret"));
         }
         else
         {
             return;
         }
     }
 }
Beispiel #10
0
        private void SavePreferences(SettingsSave saveLevel, Action saveToProject, Action
                                     saveToEditor)
        {
            switch (saveLevel)
            {
            case SettingsSave.ProjectOnly:
                saveToProject();
                break;

            case SettingsSave.EditorPrefs:
                saveToEditor();
                break;

            case SettingsSave.BothProjectAndEditorPrefs:
            default:
                saveToEditor();
                saveToProject();
                break;
            }
        }
Beispiel #11
0
 private void OnsettingsChanged(SettingsSave config)
 {
     doubleClickSpeed = config.controls.doubleClickSpeed;
     mouseSensitivity = config.controls.mouseSensitivity;
 }
Beispiel #12
0
 //method to save def mail
 public void SaveDefaultMail(string login, string password)
 {
     SettingsSave.SetSetting("login", login);
     SettingsSave.SetSetting("password", Encryptor.Encrypt(_key, password));
 }
Beispiel #13
0
 /// <summary>
 /// Set a string property.
 /// </summary>
 /// <param name="name">Name of the value.</param>
 /// <param name="value">Value to set.</param>
 public void SetString(string name, string value, SettingsSave saveLevel)
 {
     SavePreferences(saveLevel, () => { Set(name, value); },
                     () => { EditorPrefs.SetString(name, value); });
 }