Example #1
0
        private static ActionResult SaveSettings()
        {
            var result = new ActionResult();

            try
            {
                DataStorage.StoreObject(config, configFile, useIndentations: true);
            }
            catch (Exception)
            {
                result.AddAlert(new Alert("Settings error", "Could not save the Settings", LevelEnum.Exception));
            }

            return(result);
        }
        private static ActionResult SaveSettings()
        {
            var result = new ActionResult();

            try
            {
                InversionOfControl.Container.GetInstance <JsonDataStorage>().StoreObject(config, configFile);
            }
            catch (Exception)
            {
                result.AddAlert(new Alert("Błąd ustawień", "Nie udało się zapisać zmian", LevelEnum.Exception));
            }

            return(result);
        }
        private static ActionResult SaveSettings()
        {
            var result = new ActionResult();

            try
            {
                InversionOfControl.Container.GetInstance <JsonDataStorage>().StoreObject(config, configFile);
            }
            catch (Exception)
            {
                result.AddAlert(new Alert("Settings error", "Could not save the Settings", LevelEnum.Exception));
            }

            return(result);
        }
Example #4
0
        internal static ActionResult StoreGuild(ulong id)
        {
            var result = new ActionResult();

            try
            {
                var selection = FindGuildConfig(id);
                DataStorage.StoreObject(selection, GuildsFolder + "/" + id + "/config.json", _guildGlobalSettings.UseNiceFormatting);
            }
            catch
            {
                result.AddAlert(new Alert("SaveGuild", "Could not save guild", LevelEnum.Exception));
            }

            return(result);
        }