コード例 #1
0
        protected bool method_2(object object_0, JsonContract jsonContract_0, object object_1, IJsonLineInfo ijsonLineInfo_0, string string_0, Exception exception_0)
        {
            ErrorContext context = this.method_0(object_0, object_1, string_0, exception_0);

            if (((this.itraceWriter_0 != null) && (this.itraceWriter_0.LevelFilter >= TraceLevel.Error)) && !context.Boolean_0)
            {
                context.Boolean_0 = true;
                string str = this.bool_0 ? "Error serializing" : "Error deserializing";
                if (jsonContract_0 != null)
                {
                    str = str + " " + jsonContract_0.UnderlyingType;
                }
                str = str + ". " + exception_0.Message;
                if (!(exception_0 is JsonException))
                {
                    str = Struct25.smethod_2(ijsonLineInfo_0, string_0, str);
                }
                this.itraceWriter_0.Trace(TraceLevel.Error, str, exception_0);
            }
            if (jsonContract_0 != null)
            {
                jsonContract_0.method_4(object_0, this.jsonSerializer_0.StreamingContext_0, context);
            }
            if (!context.Handled)
            {
                this.jsonSerializer_0.method_3(new ErrorEventArgs(object_0, context));
            }
            return(context.Handled);
        }
コード例 #2
0
 private void method_16(JsonWriter jsonWriter_0, JsonContract jsonContract_1, object object_0)
 {
     if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Info))
     {
         base.itraceWriter_0.Trace(TraceLevel.Info, Struct25.smethod_2(null, jsonWriter_0.Path, "Finished serializing {0}".smethod_0(CultureInfo.InvariantCulture, jsonContract_1.UnderlyingType)), null);
     }
     jsonContract_1.method_1(object_0, base.jsonSerializer_0.streamingContext_0);
 }
コード例 #3
0
 private void method_1(Enum12 enum12_0)
 {
     if (this.struct25_0.enum12_0 != Enum12.None)
     {
         this.list_0.Add(this.struct25_0);
     }
     this.struct25_0 = new Struct25(enum12_0);
 }
コード例 #4
0
        private void method_21(JsonWriter jsonWriter_0, Type type_0)
        {
            string str = Class194.smethod_4(type_0, base.jsonSerializer_0.formatterAssemblyStyle_0, base.jsonSerializer_0.serializationBinder_0);

            if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Verbose))
            {
                base.itraceWriter_0.Trace(TraceLevel.Verbose, Struct25.smethod_2(null, jsonWriter_0.Path, "Writing type name '{0}' for {1}.".smethod_1(CultureInfo.InvariantCulture, str, type_0)), null);
            }
            jsonWriter_0.WritePropertyName("$type", false);
            jsonWriter_0.WriteValue(str);
        }
コード例 #5
0
        private void method_20(JsonWriter jsonWriter_0, Type type_0, object object_0)
        {
            string str = this.method_13(jsonWriter_0, object_0);

            if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Verbose))
            {
                base.itraceWriter_0.Trace(TraceLevel.Verbose, Struct25.smethod_2(null, jsonWriter_0.Path, "Writing object reference Id '{0}' for {1}.".smethod_1(CultureInfo.InvariantCulture, str, type_0)), null);
            }
            jsonWriter_0.WritePropertyName("$id", false);
            jsonWriter_0.WriteValue(str);
        }
コード例 #6
0
        private void method_12(JsonWriter jsonWriter_0, object object_0)
        {
            string str = this.method_13(jsonWriter_0, object_0);

            if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Info))
            {
                base.itraceWriter_0.Trace(TraceLevel.Info, Struct25.smethod_2(null, jsonWriter_0.Path, "Writing object reference to Id '{0}' for {1}.".smethod_1(CultureInfo.InvariantCulture, str, object_0.GetType())), null);
            }
            jsonWriter_0.WriteStartObject();
            jsonWriter_0.WritePropertyName("$ref", false);
            jsonWriter_0.WriteValue(str);
            jsonWriter_0.WriteEndObject();
        }
コード例 #7
0
        private bool method_38(JsonWriter jsonWriter_0, JsonProperty jsonProperty_0, object object_0)
        {
            if (jsonProperty_0.GetIsSpecified == null)
            {
                return(true);
            }
            bool flag = jsonProperty_0.GetIsSpecified(object_0);

            if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Verbose))
            {
                base.itraceWriter_0.Trace(TraceLevel.Verbose, Struct25.smethod_2(null, jsonWriter_0.Path, "IsSpecified result for property '{0}' on {1}: {2}".smethod_2(CultureInfo.InvariantCulture, jsonProperty_0.PropertyName, jsonProperty_0.DeclaringType, flag)), null);
            }
            return(flag);
        }
コード例 #8
0
        private Enum12 method_2()
        {
            Struct25 struct2 = this.struct25_0;

            if (this.list_0.Count > 0)
            {
                this.struct25_0 = this.list_0[this.list_0.Count - 1];
                this.list_0.RemoveAt(this.list_0.Count - 1);
            }
            else
            {
                this.struct25_0 = new Struct25();
            }
            return(struct2.enum12_0);
        }
コード例 #9
0
        private bool method_11(JsonWriter jsonWriter_0, object object_0, JsonProperty jsonProperty_0, JsonContract jsonContract_1, JsonContainerContract jsonContainerContract_0, JsonProperty jsonProperty_1)
        {
            if (((object_0 != null) && (jsonContract_1.enum15_0 != Enum15.Primitive)) && (jsonContract_1.enum15_0 != Enum15.String))
            {
                ReferenceLoopHandling?referenceLoopHandling = null;
                if (jsonProperty_0 != null)
                {
                    referenceLoopHandling = jsonProperty_0.ReferenceLoopHandling;
                }
                if (!referenceLoopHandling.HasValue && (jsonProperty_1 != null))
                {
                    referenceLoopHandling = jsonProperty_1.ItemReferenceLoopHandling;
                }
                if (!referenceLoopHandling.HasValue && (jsonContainerContract_0 != null))
                {
                    referenceLoopHandling = jsonContainerContract_0.ItemReferenceLoopHandling;
                }
                if (this.list_0.IndexOf(object_0) != -1)
                {
                    string str = "Self referencing loop detected";
                    if (jsonProperty_0 != null)
                    {
                        str = str + " for property '{0}'".smethod_0(CultureInfo.InvariantCulture, jsonProperty_0.PropertyName);
                    }
                    str = str + " with type '{0}'.".smethod_0(CultureInfo.InvariantCulture, object_0.GetType());
                    switch (referenceLoopHandling.GetValueOrDefault(base.jsonSerializer_0.referenceLoopHandling_0))
                    {
                    case ReferenceLoopHandling.Error:
                        throw JsonSerializationException.smethod_3(null, jsonWriter_0.String_0, str, null);

                    case ReferenceLoopHandling.Ignore:
                        if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Verbose))
                        {
                            base.itraceWriter_0.Trace(TraceLevel.Verbose, Struct25.smethod_2(null, jsonWriter_0.Path, str + ". Skipping serializing self referenced value."), null);
                        }
                        return(false);

                    case ReferenceLoopHandling.Serialize:
                        if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Verbose))
                        {
                            base.itraceWriter_0.Trace(TraceLevel.Verbose, Struct25.smethod_2(null, jsonWriter_0.Path, str + ". Serializing self referenced value."), null);
                        }
                        return(true);
                    }
                }
            }
            return(true);
        }
コード例 #10
0
        internal static JsonReaderException smethod_3(IJsonLineInfo ijsonLineInfo_0, string string_0, string string_1, Exception exception_0)
        {
            int lineNumber;
            int linePosition;

            string_1 = Struct25.smethod_2(ijsonLineInfo_0, string_0, string_1);
            if ((ijsonLineInfo_0 != null) && ijsonLineInfo_0.HasLineInfo())
            {
                lineNumber   = ijsonLineInfo_0.LineNumber;
                linePosition = ijsonLineInfo_0.LinePosition;
            }
            else
            {
                lineNumber   = 0;
                linePosition = 0;
            }
            return(new JsonReaderException(string_1, exception_0, string_0, lineNumber, linePosition));
        }
コード例 #11
0
 private void method_25(JsonWriter jsonWriter_0, JsonConverter jsonConverter_0, object object_0, JsonContract jsonContract_1, JsonContainerContract jsonContainerContract_0, JsonProperty jsonProperty_0)
 {
     if (this.method_9(object_0, null, jsonContract_1, jsonContainerContract_0, jsonProperty_0))
     {
         this.method_12(jsonWriter_0, object_0);
     }
     else if (this.method_11(jsonWriter_0, object_0, null, jsonContract_1, jsonContainerContract_0, jsonProperty_0))
     {
         this.list_0.Add(object_0);
         if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Info))
         {
             base.itraceWriter_0.Trace(TraceLevel.Info, Struct25.smethod_2(null, jsonWriter_0.Path, "Started serializing {0} with converter {1}.".smethod_1(CultureInfo.InvariantCulture, object_0.GetType(), jsonConverter_0.GetType())), null);
         }
         jsonConverter_0.WriteJson(jsonWriter_0, object_0, this.method_4());
         if ((base.itraceWriter_0 != null) && (base.itraceWriter_0.LevelFilter >= TraceLevel.Info))
         {
             base.itraceWriter_0.Trace(TraceLevel.Info, Struct25.smethod_2(null, jsonWriter_0.Path, "Finished serializing {0} with converter {1}.".smethod_1(CultureInfo.InvariantCulture, object_0.GetType(), jsonConverter_0.GetType())), null);
         }
         this.list_0.RemoveAt(this.list_0.Count - 1);
     }
 }
コード例 #12
0
 private void method_1(Enum12 enum12_0)
 {
     this.method_11();
     if (this.struct25_0.enum12_0 == Enum12.None)
     {
         this.struct25_0 = new Struct25(enum12_0);
     }
     else
     {
         this.list_0.Add(this.struct25_0);
         this.struct25_0 = new Struct25(enum12_0);
         if (this.nullable_0.HasValue)
         {
             int num = this.Int32_0 + 1;
             if ((num > this.nullable_0) && !this.bool_0)
             {
                 this.bool_0 = true;
                 throw JsonReaderException.smethod_1(this, "The reader's MaxDepth of {0} has been exceeded.".smethod_0(CultureInfo.InvariantCulture, this.nullable_0));
             }
         }
     }
 }
コード例 #13
0
        private Enum12 method_2()
        {
            Struct25 struct2;

            if (this.list_0.Count > 0)
            {
                struct2         = this.struct25_0;
                this.struct25_0 = this.list_0[this.list_0.Count - 1];
                this.list_0.RemoveAt(this.list_0.Count - 1);
            }
            else
            {
                struct2         = this.struct25_0;
                this.struct25_0 = new Struct25();
            }
            if (this.nullable_0.HasValue)
            {
                if (this.Int32_0 <= this.nullable_0)
                {
                    this.bool_0 = false;
                }
            }
            return(struct2.enum12_0);
        }
コード例 #14
0
 private IntPtr method_1(int snoRecordId)
 {
     try
     {
         byte[]   bytes   = BitConverter.GetBytes(snoRecordId);
         uint     num     = (uint)(bytes[3] ^ (0x1000193 * (bytes[2] ^ (0x1000193 * (bytes[1] ^ (0x1000193 * (bytes[0] ^ (0x1000193 * (snoRecordId ^ -2128831035)))))))));
         Struct15 native  = this.Native;
         Struct25 struct3 = base.Memory.UnsafeReadToStruct <Struct25>(native.intptr_3);
         num &= struct3.uint_0;
         IntPtr address = base.Memory.UnsafeReadToStruct <IntPtr>(new IntPtr((uint)struct3.intptr_0 + (num * 4)));
         if (!(address != IntPtr.Zero))
         {
             return(IntPtr.Zero);
         }
         Struct24 struct4 = base.Memory.UnsafeReadToStruct <Struct24>(address);
         while (struct4.uint_0 != snoRecordId)
         {
             if (struct4.intptr_0 == IntPtr.Zero)
             {
                 return(IntPtr.Zero);
             }
             struct4 = base.Memory.UnsafeReadToStruct <Struct24>(struct4.intptr_0);
         }
         IntPtr[] addresses = new IntPtr[] { base.BaseAddress + 60, (IntPtr)0x148, (IntPtr)(0x10 * struct4.uint_1) };
         IntPtr   ptr2      = base.Memory.UnsafeReadPointersToStruct <IntPtr>(false, addresses);
         if (!(ptr2 != IntPtr.Zero))
         {
             return(IntPtr.Zero);
         }
         return(ptr2);
     }
     catch
     {
     }
     return(IntPtr.Zero);
 }
コード例 #15
0
 internal static JsonWriterException smethod_2(string string_0, string string_1, Exception exception_0)
 {
     string_1 = Struct25.smethod_2(null, string_0, string_1);
     return(new JsonWriterException(string_1, exception_0, string_0));
 }
コード例 #16
0
 internal static JsonException smethod_0(IJsonLineInfo ijsonLineInfo_0, string string_0, string string_1)
 {
     string_1 = Struct25.smethod_2(ijsonLineInfo_0, string_0, string_1);
     return(new JsonException(string_1));
 }
コード例 #17
0
 internal static JsonSerializationException smethod_3(IJsonLineInfo ijsonLineInfo_0, string string_0, string string_1, Exception exception_0)
 {
     string_1 = Struct25.smethod_2(ijsonLineInfo_0, string_0, string_1);
     return(new JsonSerializationException(string_1, exception_0));
 }