Inheritance: ConfigurationData
Ejemplo n.º 1
0
        public ConfigurationDataNCore(JToken json)
        {
            ConfigurationDataNCore configData = new ConfigurationDataNCore();

            dynamic configArray = JsonConvert.DeserializeObject(json.ToString());
            foreach (var config in configArray)
            {
                string propertyName = UppercaseFirst((string)config.id);
                switch (propertyName)
                {
                    case "Username":
                        Username = new StringItem { Name = propertyName, Value = config.value };
                        break;
                    case "Password":
                        Password = new StringItem { Name = propertyName, Value = config.value };
                        break;
                    case "Hungarian":
                        Hungarian = new BoolItem { Name = propertyName, Value = config.value };
                        break;
                    case "English":
                        English = new BoolItem { Name = propertyName, Value = config.value };
                        break;
                    default:
                        break;
                }
            }
        }
Ejemplo n.º 2
0
        public ConfigurationDataNCore(JToken json)
        {
            ConfigurationDataNCore configData = new ConfigurationDataNCore();

            dynamic configArray = JsonConvert.DeserializeObject(json.ToString());

            foreach (var config in configArray)
            {
                string propertyName = UppercaseFirst((string)config.id);
                switch (propertyName)
                {
                case "Username":
                    Username = new StringItem {
                        Name = propertyName, Value = config.value
                    };
                    break;

                case "Password":
                    Password = new StringItem {
                        Name = propertyName, Value = config.value
                    };
                    break;

                case "Twofactor":
                    TwoFactor = new StringItem {
                        Name = propertyName, Value = config.value
                    };
                    break;

                case "Hungarian":
                    Hungarian = new BoolItem {
                        Name = propertyName, Value = config.value
                    };
                    break;

                case "English":
                    English = new BoolItem {
                        Name = propertyName, Value = config.value
                    };
                    break;

                default:
                    break;
                }
            }
        }