Пример #1
0
        /// <summary>Constructor</summary>
        /// <param name="json">json object to parse into a Config</param>
        public static Config Parse(JObject json)
        {
            Config c = new Config();

            c.Option  = ConfigOption.Parse((JObject)json["options"]);
            c.Context = ConfigContext.Parse((JObject)json["context"]);
            c.ID      = (string)json["id"];
            return(c);
        }
Пример #2
0
        /// <summary>parse a json object into a Config Option</summary>
        /// <param name="json">converts the json object to a ConfigOption</param>
        public static ConfigOption Parse(JObject json)
        {
            ConfigOption co = new ConfigOption();

            co.IsRequired   = (bool?)json["is_required"];
            co.DefaultValue = (string)json["default_value"];
            co.Format       = (string)json["format"];
            co.Rows         = (string)json["rows"];
            return(co);
        }