예제 #1
0
 // Token: 0x06000998 RID: 2456 RVA: 0x0003748C File Offset: 0x0003568C
 private bool method_20(JsonWriter jsonWriter_0, object object_0, JsonContainerContract jsonContainerContract_0, JsonProperty jsonProperty_0, JsonProperty jsonProperty_1, out JsonContract jsonContract_0, out object object_1)
 {
     if (!jsonProperty_1.Ignored && jsonProperty_1.Readable && this.ShouldSerialize(jsonWriter_0, jsonProperty_1, object_0) && this.method_40(jsonWriter_0, jsonProperty_1, object_0))
     {
         if (jsonProperty_1.method_0() == null)
         {
             jsonProperty_1.method_1(this.jsonSerializer_0.icontractResolver_0.ResolveContract(jsonProperty_1.PropertyType));
         }
         object_1       = jsonProperty_1.ValueProvider.GetValue(object_0);
         jsonContract_0 = (jsonProperty_1.method_0().bool_4 ? jsonProperty_1.method_0() : this.method_7(object_1));
         if (this.method_12(object_1, jsonContainerContract_0 as JsonObjectContract, jsonProperty_1))
         {
             if (this.method_11(object_1, jsonProperty_1, jsonContract_0, jsonContainerContract_0, jsonProperty_0))
             {
                 jsonProperty_1.method_3(jsonWriter_0);
                 this.method_14(jsonWriter_0, object_1);
                 return(false);
             }
             if (!this.method_13(jsonWriter_0, object_1, jsonProperty_1, jsonContract_0, jsonContainerContract_0, jsonProperty_0))
             {
                 return(false);
             }
             if (object_1 == null)
             {
                 JsonObjectContract jsonObjectContract = jsonContainerContract_0 as JsonObjectContract;
                 Required           required           = jsonProperty_1.nullable_0 ?? (((jsonObjectContract != null) ? jsonObjectContract.ItemRequired : null) ?? Required.Default);
                 if (required == Required.Always)
                 {
                     throw JsonSerializationException.Create(null, jsonWriter_0.xEuXaafal7(), "Cannot write a null value for property '{0}'. Property requires a value.".smethod_0(CultureInfo.InvariantCulture, jsonProperty_1.PropertyName), null);
                 }
                 if (required == Required.DisallowNull)
                 {
                     throw JsonSerializationException.Create(null, jsonWriter_0.xEuXaafal7(), "Cannot write a null value for property '{0}'. Property requires a non-null value.".smethod_0(CultureInfo.InvariantCulture, jsonProperty_1.PropertyName), null);
                 }
             }
             return(true);
         }
     }
     jsonContract_0 = null;
     object_1       = null;
     return(false);
 }
예제 #2
0
 private bool method_10(object object_0, JsonProperty jsonProperty_0)
 {
     if ((((NullValueHandling)jsonProperty_0.NullValueHandling.GetValueOrDefault(base.jsonSerializer_0.nullValueHandling_0)) == NullValueHandling.Ignore) && (object_0 == null))
     {
         return(false);
     }
     if (this.method_22(jsonProperty_0.DefaultValueHandling.GetValueOrDefault(base.jsonSerializer_0.defaultValueHandling_0), DefaultValueHandling.Ignore) && Class193.smethod_0(object_0, jsonProperty_0.method_1()))
     {
         return(false);
     }
     return(true);
 }