public static void TriggerOnSettingsChanged(SettingsSave config) { if (OnSettingsChanged != null) { OnSettingsChanged(config); } }
private void OnsettingsChanged(SettingsSave config) { if (bindings != config.controls.keyBindings) { bindings = config.controls.keyBindings; } }
//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); }
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); } }
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); }
/// <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(); } }
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(); }
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; } } }
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; } }
private void OnsettingsChanged(SettingsSave config) { doubleClickSpeed = config.controls.doubleClickSpeed; mouseSensitivity = config.controls.mouseSensitivity; }
//method to save def mail public void SaveDefaultMail(string login, string password) { SettingsSave.SetSetting("login", login); SettingsSave.SetSetting("password", Encryptor.Encrypt(_key, password)); }
/// <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); }); }