Ejemplo n.º 1
0
        public StringConfiguration GetStringConfigurationItem(string key, bool isDebugging)
        {
            if (this.StringConfiguration.ContainsKey(key))
                return this.StringConfiguration[key];

            StringConfiguration config = new StringConfiguration();
            config.Key = key;

            if (isDebugging)
                config.Value = string.Format("Không tìm thấy key {0}", key);
            else
                config.Value = "";

            return config;
        } 
        public void ChangeTextSetting(string key, string value, ISession session)
        {
            if (Configuration.TribalWarsConfiguration.StringConfiguration.ContainsKey(key))
            {
                StringConfiguration config = Configuration.TribalWarsConfiguration.StringConfiguration[key];

                StringConfiguration config1 = session.Get<StringConfiguration>(key);
                config1.Value = value;
                config.Value = value;
                session.Update(config1);
            }
            else
            {
                StringConfiguration config = new StringConfiguration();
                config.Key = key;
                config.Value = value;
                Configuration.TribalWarsConfiguration.StringConfiguration.Add(key, config);
                session.Save(config);
            }
        }
Ejemplo n.º 3
0
        public void InsertOrUpdateConfiguration(StringConfiguration stringConfiguration, ISession session)
        {
            if (this.NumericConfiguration.ContainsKey(stringConfiguration.Key))
                session.Update(stringConfiguration);

            session.Save(stringConfiguration);
        }