private void SetDefault(string ActionName) { if (ActionName == DefaultAction.Value) { return; } using (SettingsContext Settings = new SettingsContext()) { GRSystem Config = Settings.System.Find(ConfigId); // Set the default configs if (Config == null) { Config = new GRSystem() { Key = ConfigId, Type = GSDataType.STRING }; Config.Value = ActionName; Settings.System.Add(Config); } else { Config.Value = ActionName; Settings.System.Update(Config); } Settings.SaveChanges(); } DefaultAction.Value = ActionName; }
private string GetDefault() { using (SettingsContext Settings = new SettingsContext()) { GRSystem Config = Settings.System.Find(ConfigId); // Set the default configs if (Config == null) { return("Info"); } else { return(Config.Value); } } }