Example #1
0
        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;
        }
Example #2
0
        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);
                }
            }
        }