示例#1
0
        public Document CombineWith(JObject jobj)
        {
            Newtonsoft.Json.JsonWriter jwriter = CreateWriter();
            IEnumerator <JToken>       en      = jobj.Children().GetEnumerator();

            while (en.MoveNext())
            {
                if (en.Current.Type != JTokenType.Property)
                {
                    throw new Json.JsonParseException("Property was expected.");
                }
                if (this[((JProperty)en.Current).Name] == null)
                {
                    Newtonsoft.Json.JsonConverter conv = new Newtonsoft.Json.Converters.KeyValuePairConverter();
                    en.Current.WriteTo(jwriter, new Newtonsoft.Json.JsonConverter[] { conv });
                }
            }

            return(this);
        }
示例#2
0
        public Document CombineWith(JObject jobj)
        {
            Newtonsoft.Json.JsonWriter jwriter = CreateWriter();
            IEnumerator<JToken> en = jobj.Children().GetEnumerator();

            while (en.MoveNext())
            {
                if (en.Current.Type != JTokenType.Property)
                    throw new Json.JsonParseException("Property was expected.");
                if (this[((JProperty)en.Current).Name] == null)
                {
                    Newtonsoft.Json.JsonConverter conv = new Newtonsoft.Json.Converters.KeyValuePairConverter();
                    en.Current.WriteTo(jwriter, new Newtonsoft.Json.JsonConverter[] { conv });
                }
            }

            return this;
        }