Example #1
0
 public JsonSchema Generate(Type type, JsonSchemaResolver resolver, bool rootSchemaNullable)
 {
     Class203.smethod_2(type, "type");
     Class203.smethod_2(resolver, "resolver");
     this.jsonSchemaResolver_0 = resolver;
     return(this.method_5(type, !rootSchemaNullable ? Required.Always : Required.Default, false));
 }
Example #2
0
 public Class133(Type type, JsonSchema schema)
 {
     Class203.smethod_2(type, "type");
     Class203.smethod_2(schema, "schema");
     this.Type_0       = type;
     this.JsonSchema_0 = schema;
 }
Example #3
0
        int Interface21.OffsetToIndex(Class196 dc, double offset, string text, string textSplit, float clientWidth, float clientActiveAreaWidth, bool bIsFirstSplit)
        {
            int      num    = 3;
            float    num2   = this.method_41(dc, clientWidth);
            Class210 class2 = base.interface23_0 as Class210;
            bool     flag2  = (class2 != null) ? class2.Interface23.imethod_26() : true;
            bool     flag   = (base.OwnerParagraph != null) && base.OwnerParagraph.method_46();

            flag = (num2 <= 0f) || flag;
            int   num4  = dc.method_401(text, this, textSplit, offset, !flag2, flag, num2, clientActiveAreaWidth);
            float width = dc.method_323(this, BookmarkStart.b("न", num)).Width;

            if ((num4 > 0) && (!flag || (num2 >= width)))
            {
                int num6 = Class203.smethod_4(textSplit, num4);
                if (num6 < 0)
                {
                    if ((num4 + num6) <= 0)
                    {
                        string str = text.Substring(0, num4 + Math.Abs(num6));
                        if (dc.method_323(this, str).Width < num2)
                        {
                            num4 += num6;
                        }
                    }
                }
                else
                {
                    num4 += num6;
                }
            }
            if ((num2 > width) && (num4 < textSplit.Length))
            {
                int num7 = num4;
                if (((offset != num2) && (num4 < 1)) || flag)
                {
                    num7++;
                }
                if (num7 > -1)
                {
                    for (int i = num7; i < textSplit.Length; i++)
                    {
                        if ((textSplit[i] != ' ') && (textSplit[i] != '\x00a0'))
                        {
                            break;
                        }
                        num4++;
                    }
                }
            }
            if (((num4 <= 0) && (Class59.smethod_5((double)num2, offset, 0.005) == 0)) && !flag)
            {
                num4 = -2147483648;
            }
            if (((num4 <= 0) && (Class59.smethod_5((double)num2, 0.0, 0.005) <= 0)) && flag)
            {
                num4 = -2147483648;
            }
            return(num4);
        }
Example #4
0
        public static JsonSchema Parse(string json, JsonSchemaResolver resolver)
        {
            Class203.smethod_2(json, "json");
            JsonReader reader = new JsonTextReader(new StringReader(json));

            return(Read(reader, resolver));
        }
Example #5
0
 internal static IEnumerable<U> smethod_0<T, U>(this IEnumerable<T> ienumerable_0, object object_0) where T: JToken
 {
     Class203.smethod_2(ienumerable_0, "source");
     this.ienumerator_0 = ienumerable_0.GetEnumerator();
 Label_00FB:
     while (this.ienumerator_0.MoveNext())
     {
         this.jtoken_0 = this.ienumerator_0.Current;
         if (object_0 == null)
         {
             if (this.jtoken_0 is JValue)
             {
                 goto Label_0115;
             }
             this.ienumerator_1 = this.jtoken_0.Children().GetEnumerator();
             while (this.ienumerator_1.MoveNext())
             {
                 this.jtoken_1 = this.ienumerator_1.Current;
                 yield return this.jtoken_1.smethod_2<JToken, U>();
             }
             this.method_1();
             continue;
         }
         this.jtoken_2 = this.jtoken_0[object_0];
         if (this.jtoken_2 != null)
         {
             yield return this.jtoken_2.smethod_2<JToken, U>();
             continue;
         }
     }
     this.method_0();
 Label_0115:
     yield return ((JValue) this.jtoken_0).smethod_2<JValue, U>();
     goto Label_00FB;
 }
Example #6
0
        private T method_0 <T>(object object_0)
        {
            Class203.smethod_2(object_0, "value");
            JValue value2 = (JValue)object_0;

            return((T)System.Convert.ChangeType(value2.Value, typeof(T), CultureInfo.InvariantCulture));
        }
Example #7
0
        internal bool method_6(IDynamicMetaObjectProvider idynamicMetaObjectProvider_0, string string_0, object object_0)
        {
            Class203.smethod_2(idynamicMetaObjectProvider_0, "dynamicProvider");
            CallSite <Func <CallSite, object, object, object> > site = this.class178_1.method_0(string_0);

            return(!object.ReferenceEquals(site.Target(site, idynamicMetaObjectProvider_0, object_0), Class161.object_0));
        }
Example #8
0
 public Class88(string expression)
 {
     Class203.smethod_2(expression, "expression");
     this.string_0 = expression;
     this.List_0   = new List <object>();
     this.method_0();
 }
Example #9
0
 public JProperty(string name, object content)
 {
     this.list_0 = new List <JToken>();
     Class203.smethod_2(name, "name");
     this.string_0 = name;
     this.Value    = base.method_4(content) ? new JArray(content) : base.method_9(content);
 }
Example #10
0
 protected Class135(JsonSerializer serializer)
 {
     Class203.smethod_2(serializer, "serializer");
     this.jsonSerializer_0 = serializer;
     this.itraceWriter_0   = serializer.ITraceWriter_0;
     this.bool_0           = base.GetType() == typeof(Class137);
 }
Example #11
0
 public void WriteRegex(string pattern, string options)
 {
     Class203.smethod_2(pattern, "pattern");
     base.method_0();
     base.method_11(JsonToken.Undefined);
     this.method_23(new Class76(pattern, options));
 }
Example #12
0
        public static JsonSchema Read(JsonReader reader, JsonSchemaResolver resolver)
        {
            Class203.smethod_2(reader, "reader");
            Class203.smethod_2(resolver, "resolver");
            Class130 class2 = new Class130(resolver);

            return(class2.method_2(reader));
        }
Example #13
0
 internal JContainer(JContainer other) : this()
 {
     Class203.smethod_2(other, "c");
     foreach (JToken token in (IEnumerable <JToken>)other)
     {
         this.Add(token);
     }
 }
Example #14
0
 public BsonReader(BinaryReader reader, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)
 {
     Class203.smethod_2(reader, "reader");
     this.binaryReader_0 = reader;
     this.list_1         = new List <Class69>();
     this.bool_2         = readRootValueAsArray;
     this.dateTimeKind_0 = dateTimeKindHandling;
 }
Example #15
0
 public BsonReader(Stream stream, bool readRootValueAsArray, DateTimeKind dateTimeKindHandling)
 {
     Class203.smethod_2(stream, "stream");
     this.binaryReader_0 = new BinaryReader(stream);
     this.list_1         = new List <Class69>();
     this.bool_2         = readRootValueAsArray;
     this.dateTimeKind_0 = dateTimeKindHandling;
 }
Example #16
0
 public BsonObjectId(byte[] value)
 {
     Class203.smethod_2(value, "value");
     if (value.Length != 12)
     {
         throw new ArgumentException("An ObjectId must be 12 bytes", "value");
     }
     this.Value = value;
 }
Example #17
0
 public static IJEnumerable<JProperty> Properties(this IEnumerable<JObject> source)
 {
     Class203.smethod_2(source, "source");
     if (func_0 == null)
     {
         func_0 = new Func<JObject, IEnumerable<JProperty>>(Extensions.smethod_5);
     }
     return source.SelectMany<JObject, JProperty>(func_0).AsJEnumerable<JProperty>();
 }
Example #18
0
 public object Convert(object value, TypeCode typeCode)
 {
     Class203.smethod_2(value, "value");
     if (value is JValue)
     {
         value = ((JValue)value).Value;
     }
     return(System.Convert.ChangeType(value, typeCode, CultureInfo.InvariantCulture));
 }
Example #19
0
 public static U Value<T, U>(this IEnumerable<T> value) where T: JToken
 {
     Class203.smethod_2(value, "source");
     JToken token = value as JToken;
     if (token == null)
     {
         throw new ArgumentException("Source value must be a JToken.");
     }
     return token.smethod_2<JToken, U>();
 }
Example #20
0
 public void WriteObjectId(byte[] value)
 {
     Class203.smethod_2(value, "value");
     if (value.Length != 12)
     {
         throw JsonWriterException.smethod_1(this, "An object id must be 12 bytes", null);
     }
     base.method_0();
     base.method_11(JsonToken.Undefined);
     this.method_22(value, Enum11.Oid);
 }
Example #21
0
        public object Convert(object value, Type type)
        {
            Class203.smethod_2(value, "value");
            JToken token = value as JToken;

            if (token == null)
            {
                throw new ArgumentException("Value is not a JToken.", "value");
            }
            return(this.jsonSerializer_0.Deserialize(token.CreateReader(), type));
        }
Example #22
0
        public static object DeserializeObject(string value, Type type, JsonSerializerSettings settings)
        {
            Class203.smethod_2(value, "value");
            StringReader   reader     = new StringReader(value);
            JsonSerializer serializer = JsonSerializer.CreateDefault(settings);

            if (!serializer.method_0())
            {
                serializer.Boolean_0 = true;
            }
            return(serializer.Deserialize(new JsonTextReader(reader), type));
        }
Example #23
0
        internal bool method_5(IDynamicMetaObjectProvider idynamicMetaObjectProvider_0, string string_0, out object object_0)
        {
            Class203.smethod_2(idynamicMetaObjectProvider_0, "dynamicProvider");
            CallSite <Func <CallSite, object, object> > site = this.class178_0.method_0(string_0);
            object objA = site.Target(site, idynamicMetaObjectProvider_0);

            if (!object.ReferenceEquals(objA, Class161.object_0))
            {
                object_0 = objA;
                return(true);
            }
            object_0 = null;
            return(false);
        }
Example #24
0
 internal static IEnumerable<U> smethod_1<T, U>(this IEnumerable<T> ienumerable_0) where T: JToken
 {
     Class203.smethod_2(ienumerable_0, "source");
     this.ienumerator_0 = ienumerable_0.GetEnumerator();
     while (true)
     {
         if (!this.ienumerator_0.MoveNext())
         {
             this.method_0();
         }
         this.gparam_1 = this.ienumerator_0.Current;
         yield return this.gparam_1.smethod_2<JToken, U>();
     }
 }
Example #25
0
 public static void Validate(this JToken source, JsonSchema schema, ValidationEventHandler validationEventHandler)
 {
     Class203.smethod_2(source, "source");
     Class203.smethod_2(schema, "schema");
     using (JsonValidatingReader reader = new JsonValidatingReader(source.CreateReader()))
     {
         reader.Schema = schema;
         if (validationEventHandler != null)
         {
             reader.ValidationEventHandler += validationEventHandler;
         }
         while (reader.Read())
         {
         }
     }
 }
Example #26
0
        public static JObject Load(JsonReader reader)
        {
            Class203.smethod_2(reader, "reader");
            if ((reader.JsonToken_0 == JsonToken.None) && !reader.Read())
            {
                throw JsonReaderException.smethod_1(reader, "Error reading JObject from JsonReader.");
            }
            while (reader.JsonToken_0 == JsonToken.Comment)
            {
                reader.Read();
            }
            if (reader.JsonToken_0 != JsonToken.StartObject)
            {
                throw JsonReaderException.smethod_1(reader, "Error reading JObject from JsonReader. Current JsonReader item is not an object: {0}".smethod_0(CultureInfo.InvariantCulture, reader.JsonToken_0));
            }
            JObject obj2 = new JObject();

            obj2.method_0(reader as IJsonLineInfo);
            obj2.method_10(reader);
            return(obj2);
        }
Example #27
0
 internal JsonContract(Type underlyingType)
 {
     Class203.smethod_2(underlyingType, "underlyingType");
     this.UnderlyingType = underlyingType;
     this.bool_2         = underlyingType.smethod_9();
     this.bool_5         = !underlyingType.smethod_3() && !underlyingType.smethod_10();
     this.bool_0         = Class194.smethod_9(underlyingType);
     this.type_0         = (!this.bool_0 || !Class194.smethod_10(underlyingType)) ? underlyingType : Nullable.GetUnderlyingType(underlyingType);
     this.CreatedType    = this.type_0;
     this.bool_1         = Class181.smethod_3(this.type_0);
     this.bool_3         = this.type_0.smethod_7();
     if (this.type_0 == typeof(byte[]))
     {
         this.enum14_0 = Enum14.ReadAsBytes;
     }
     else if (this.type_0 == typeof(int))
     {
         this.enum14_0 = Enum14.ReadAsInt32;
     }
     else if (this.type_0 == typeof(decimal))
     {
         this.enum14_0 = Enum14.ReadAsDecimal;
     }
     else if (this.type_0 == typeof(string))
     {
         this.enum14_0 = Enum14.ReadAsString;
     }
     else if (this.type_0 == typeof(DateTime))
     {
         this.enum14_0 = Enum14.ReadAsDateTime;
     }
     else if (this.type_0 == typeof(DateTimeOffset))
     {
         this.enum14_0 = Enum14.ReadAsDateTimeOffset;
     }
     else
     {
         this.enum14_0 = Enum14.Read;
     }
 }
Example #28
0
        void JContainer.‭‏‌‏‌‫‌‍‌‮‮‫‎‫‫‬‌‭‫​‏‮‪‮‪‌‍‭‪‮(JToken jtoken_2, JToken jtoken_3)
        {
            Class203.smethod_2(jtoken_2, "o");
            if (jtoken_2.Type != JTokenType.Property)
            {
                throw new ArgumentException("Can not add {0} to {1}.".smethod_1(CultureInfo.InvariantCulture, jtoken_2.GetType(), base.GetType()));
            }
            JProperty property = (JProperty)jtoken_2;

            if (jtoken_3 != null)
            {
                JProperty property2 = (JProperty)jtoken_3;
                if (property.Name == property2.Name)
                {
                    return;
                }
            }
            if (this.class79_0.method_8(property.Name, out jtoken_3))
            {
                throw new ArgumentException("Can not add property {0} to {1}. Property with the same name already exists on object.".smethod_1(CultureInfo.InvariantCulture, property.Name, base.GetType()));
            }
        }
 public abstract void Visit(Class203 c);
Example #30
0
 public JsonPropertyCollection(Type type) : base(StringComparer.Ordinal)
 {
     Class203.smethod_2(type, "type");
     this.type_0 = type;
 }
Example #31
0
 public JsonValidatingReader(JsonReader reader)
 {
     Class203.smethod_2(reader, "reader");
     this.jsonReader_0 = reader;
     this.stack_0      = new Stack <Class91>();
 }
 public override void Visit(Class203 c) { }