示例#1
0
        // Token: 0x06001422 RID: 5154 RVA: 0x0005EB54 File Offset: 0x0005CD54
        public Class_453(Type arg_0) : base(arg_0)
        {
            this.field_5 = Class_448.Dictionary;
            Type type;
            Type type2;

            if (Class_514.ImplementsGenericDefinition(arg_0, typeof(IDictionary <, >), out this.field_0))
            {
                type  = this.field_0.GetGenericArguments()[0];
                type2 = this.field_0.GetGenericArguments()[1];
                if (Class_514.IsGenericDefinition(base.prop_0, typeof(IDictionary <, >)))
                {
                    base.prop_1 = typeof(Dictionary <, >).MakeGenericType(new Type[]
                    {
                        type,
                        type2
                    });
                }
            }
            else
            {
                Class_514.GetDictionaryKeyValueTypes(base.prop_0, out type, out type2);
                if (base.prop_0 == typeof(IDictionary))
                {
                    base.prop_1 = typeof(Dictionary <object, object>);
                }
            }
            if (type != null && type2 != null)
            {
                this.field_4 = Class_510.ResolveEnumerableCollectionConstructor(base.prop_1, typeof(KeyValuePair <, >).MakeGenericType(new Type[]
                {
                    type,
                    type2
                }));
                if (!this.prop_6 && arg_0.Name == "FSharpMap`2")
                {
                    Class_484.EnsureInitialized(arg_0.Assembly);
                    this.field_5 = Class_484.CreateMap(type, type2);
                }
            }
            this.prop_4 = !typeof(IDictionary).IsAssignableFrom(base.prop_1);
            this.prop_1 = type;
            this.prop_2 = type2;
        }
示例#2
0
        // Token: 0x06001030 RID: 4144 RVA: 0x00050F3C File Offset: 0x0004F13C
        private void kmethod_2967(Class_296 arg_0, Class_387 arg_1, XmlNamespaceManager arg_2, bool bool_0)
        {
            Func <Class_387, bool> func = null;

            Class_407.NClass_0 nclass_ = new Class_407.NClass_0();
            nclass_.field_1 = arg_1;
            switch (nclass_.field_1.prop_0)
            {
            case XmlNodeType.Element:
                if (this.vmethod_2965(nclass_.field_1))
                {
                    IEnumerable <Class_387> source = nclass_.field_1.prop_2;
                    if (func == null)
                    {
                        func = new Func <Class_387, bool>(nclass_.nmethod_1);
                    }
                    if (source.All(func) && nclass_.field_1.prop_2.Count > 0)
                    {
                        this.dmethod_2966(arg_0, nclass_.field_1, arg_2, false);
                        return;
                    }
                }
                arg_2.PushScope();
                foreach (Class_387 class_ in nclass_.field_1.prop_3)
                {
                    if (class_.prop_6 == "http://www.w3.org/2000/xmlns/")
                    {
                        string prefix = (class_.prop_1 != "xmlns") ? class_.prop_1 : string.Empty;
                        string uri    = class_.prop_5;
                        arg_2.AddNamespace(prefix, uri);
                    }
                }
                if (bool_0)
                {
                    arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                }
                if (!this.smethod_2980(nclass_.field_1.prop_3).Any <Class_387>() && nclass_.field_1.prop_2.Count == 1 && nclass_.field_1.prop_2[0].prop_0 == XmlNodeType.Text)
                {
                    arg_0.kmethod_2037(nclass_.field_1.prop_2[0].prop_5);
                }
                else if (nclass_.field_1.prop_2.Count == 0 && Class_510.IsNullOrEmpty <Class_387>(nclass_.field_1.prop_3))
                {
                    Class_391 class_2 = (Class_391)nclass_.field_1;
                    if (class_2.prop_0)
                    {
                        arg_0.gmethod_2033();
                    }
                    else
                    {
                        arg_0.kmethod_2037(string.Empty);
                    }
                }
                else
                {
                    arg_0.kmethod_2007();
                    for (int i = 0; i < nclass_.field_1.prop_3.Count; i++)
                    {
                        this.kmethod_2967(arg_0, nclass_.field_1.prop_3[i], arg_2, true);
                    }
                    this.dmethod_2966(arg_0, nclass_.field_1, arg_2, true);
                    arg_0.lmethod_2008();
                }
                arg_2.PopScope();
                return;

            case XmlNodeType.Attribute:
            case XmlNodeType.Text:
            case XmlNodeType.CDATA:
            case XmlNodeType.ProcessingInstruction:
            case XmlNodeType.Whitespace:
            case XmlNodeType.SignificantWhitespace:
                if (nclass_.field_1.prop_6 == "http://www.w3.org/2000/xmlns/" && nclass_.field_1.prop_5 == "http://james.newtonking.com/projects/json")
                {
                    return;
                }
                if (nclass_.field_1.prop_6 == "http://james.newtonking.com/projects/json" && nclass_.field_1.prop_1 == "Array")
                {
                    return;
                }
                if (bool_0)
                {
                    arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                }
                arg_0.kmethod_2037(nclass_.field_1.prop_5);
                return;

            case XmlNodeType.Comment:
                if (bool_0)
                {
                    arg_0.vmethod_2075(nclass_.field_1.prop_5);
                    return;
                }
                return;

            case XmlNodeType.Document:
            case XmlNodeType.DocumentFragment:
                this.dmethod_2966(arg_0, nclass_.field_1, arg_2, bool_0);
                return;

            case XmlNodeType.DocumentType:
            {
                Class_395 class_3 = (Class_395)nclass_.field_1;
                arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                arg_0.kmethod_2007();
                if (!string.IsNullOrEmpty(class_3.prop_0))
                {
                    arg_0.gmethod_2013("@name");
                    arg_0.kmethod_2037(class_3.prop_0);
                }
                if (!string.IsNullOrEmpty(class_3.prop_2))
                {
                    arg_0.gmethod_2013("@public");
                    arg_0.kmethod_2037(class_3.prop_2);
                }
                if (!string.IsNullOrEmpty(class_3.prop_1))
                {
                    arg_0.gmethod_2013("@system");
                    arg_0.kmethod_2037(class_3.prop_1);
                }
                if (!string.IsNullOrEmpty(class_3.prop_3))
                {
                    arg_0.gmethod_2013("@internalSubset");
                    arg_0.kmethod_2037(class_3.prop_3);
                }
                arg_0.lmethod_2008();
                return;
            }

            case XmlNodeType.XmlDeclaration:
            {
                Class_393 class_4 = (Class_393)nclass_.field_1;
                arg_0.gmethod_2013(this.cmethod_2964(nclass_.field_1, arg_2));
                arg_0.kmethod_2007();
                if (!string.IsNullOrEmpty(class_4.prop_0))
                {
                    arg_0.gmethod_2013("@version");
                    arg_0.kmethod_2037(class_4.prop_0);
                }
                if (!string.IsNullOrEmpty(class_4.prop_1))
                {
                    arg_0.gmethod_2013("@encoding");
                    arg_0.kmethod_2037(class_4.prop_1);
                }
                if (!string.IsNullOrEmpty(class_4.prop_2))
                {
                    arg_0.gmethod_2013("@standalone");
                    arg_0.kmethod_2037(class_4.prop_2);
                }
                arg_0.lmethod_2008();
                return;
            }
            }
            throw new Class_417("Unexpected XmlNodeType when serializing nodes: " + nclass_.field_1.prop_0);
        }
示例#3
0
 // Token: 0x06001182 RID: 4482 RVA: 0x000563F4 File Offset: 0x000545F4
 private static void gmethod_3163(Class_418 arg_0, Class_380 arg_1)
 {
     if (!Class_510.IsNullOrEmpty <Class_299>(arg_1.prop_5))
     {
         for (int i = 0; i < arg_1.prop_5.Count; i++)
         {
             arg_0.prop_13.Insert(i, arg_1.prop_5[i]);
         }
     }
     if (arg_1.field_44 != null)
     {
         arg_0.prop_3 = arg_1.prop_7;
     }
     if (arg_1.field_45 != null)
     {
         arg_0.prop_12 = arg_1.prop_8;
     }
     if (arg_1.field_35 != null)
     {
         arg_0.prop_4 = arg_1.prop_9;
     }
     if (arg_1.field_37 != null)
     {
         arg_0.prop_5 = arg_1.prop_6;
     }
     if (arg_1.field_41 != null)
     {
         arg_0.prop_6 = arg_1.prop_0;
     }
     if (arg_1.field_40 != null)
     {
         arg_0.prop_7 = arg_1.prop_1;
     }
     if (arg_1.field_39 != null)
     {
         arg_0.prop_10 = arg_1.prop_2;
     }
     if (arg_1.field_38 != null)
     {
         arg_0.prop_8 = arg_1.prop_3;
     }
     if (arg_1.field_36 != null)
     {
         arg_0.prop_9 = arg_1.prop_4;
     }
     if (arg_1.field_43 != null)
     {
         arg_0.prop_11 = arg_1.prop_10;
     }
     if (arg_1.field_42 != null)
     {
         arg_0.prop_15 = arg_1.prop_16;
     }
     if (arg_1.field_30 != null)
     {
         arg_0.field_26 = arg_1.field_30;
     }
     if (arg_1.prop_15 != null)
     {
         arg_0.Error += arg_1.prop_15;
     }
     if (arg_1.prop_11 != null)
     {
         arg_0.prop_14 = arg_1.prop_11;
     }
     if (arg_1.prop_12 != null)
     {
         arg_0.prop_0 = arg_1.prop_12;
     }
     if (arg_1.prop_13 != null)
     {
         arg_0.prop_2 = arg_1.prop_13;
     }
     if (arg_1.prop_14 != null)
     {
         arg_0.prop_1 = arg_1.prop_14;
     }
     if (arg_1.field_22 != null)
     {
         arg_0.field_16 = arg_1.field_22;
     }
     if (arg_1.field_23 != null)
     {
         arg_0.field_17 = arg_1.field_23;
     }
     if (arg_1.field_24 != null)
     {
         arg_0.field_18 = arg_1.field_24;
     }
     if (arg_1.field_25 != null)
     {
         arg_0.field_19 = arg_1.field_25;
     }
     if (arg_1.field_34)
     {
         arg_0.field_27 = arg_1.field_33;
         arg_0.field_28 = arg_1.field_34;
     }
     if (arg_1.field_26 != null)
     {
         arg_0.field_20 = arg_1.field_26;
     }
     if (arg_1.field_27 != null)
     {
         arg_0.field_21 = arg_1.field_27;
     }
     if (arg_1.field_28 != null)
     {
         arg_0.field_22 = arg_1.field_28;
     }
     if (arg_1.field_29 != null)
     {
         arg_0.field_23 = arg_1.field_29;
     }
     if (arg_1.field_32)
     {
         arg_0.field_24 = arg_1.field_31;
         arg_0.field_25 = arg_1.field_32;
     }
 }
示例#4
0
        // Token: 0x06001403 RID: 5123 RVA: 0x0005E5A4 File Offset: 0x0005C7A4
        public Class_447(Type arg_0) : base(arg_0)
        {
            this.field_5 = Class_448.Array;
            this.prop_2  = base.prop_1.IsArray;
            bool bool_;
            Type type;

            if (this.prop_2)
            {
                this.prop_0  = Class_514.GetCollectionItemType(base.prop_0);
                this.field_6 = true;
                this.field_0 = typeof(List <>).MakeGenericType(new Type[]
                {
                    this.prop_0
                });
                bool_       = true;
                this.prop_1 = (this.prop_2 && base.prop_0.GetArrayRank() > 1);
            }
            else if (typeof(IList).IsAssignableFrom(arg_0))
            {
                if (Class_514.ImplementsGenericDefinition(arg_0, typeof(ICollection <>), out this.field_0))
                {
                    this.prop_0 = this.field_0.GetGenericArguments()[0];
                }
                else
                {
                    this.prop_0 = Class_514.GetCollectionItemType(arg_0);
                }
                if (arg_0 == typeof(IList))
                {
                    base.prop_1 = typeof(List <object>);
                }
                if (this.prop_0 != null)
                {
                    this.field_4 = Class_510.ResolveEnumerableCollectionConstructor(arg_0, this.prop_0);
                }
                this.field_6 = Class_514.InheritsGenericDefinition(arg_0, typeof(ReadOnlyCollection <>));
                bool_        = true;
            }
            else if (Class_514.ImplementsGenericDefinition(arg_0, typeof(ICollection <>), out this.field_0))
            {
                this.prop_0 = this.field_0.GetGenericArguments()[0];
                if (Class_514.IsGenericDefinition(arg_0, typeof(ICollection <>)) || Class_514.IsGenericDefinition(arg_0, typeof(IList <>)))
                {
                    base.prop_1 = typeof(List <>).MakeGenericType(new Type[]
                    {
                        this.prop_0
                    });
                }
                if (Class_514.IsGenericDefinition(arg_0, typeof(ISet <>)))
                {
                    base.prop_1 = typeof(HashSet <>).MakeGenericType(new Type[]
                    {
                        this.prop_0
                    });
                }
                this.field_4 = Class_510.ResolveEnumerableCollectionConstructor(arg_0, this.prop_0);
                bool_        = true;
                this.prop_3  = true;
            }
            else if (Class_514.ImplementsGenericDefinition(arg_0, typeof(IEnumerable <>), out type))
            {
                this.prop_0 = type.GetGenericArguments()[0];
                if (Class_514.IsGenericDefinition(base.prop_0, typeof(IEnumerable <>)))
                {
                    base.prop_1 = typeof(List <>).MakeGenericType(new Type[]
                    {
                        this.prop_0
                    });
                }
                this.field_4 = Class_510.ResolveEnumerableCollectionConstructor(arg_0, this.prop_0);
                if (!this.prop_6 && arg_0.Name == "FSharpList`1")
                {
                    Class_484.EnsureInitialized(arg_0.Assembly);
                    this.field_5 = Class_484.CreateSeq(this.prop_0);
                }
                if (arg_0.IsGenericType && arg_0.GetGenericTypeDefinition() == typeof(IEnumerable <>))
                {
                    this.field_0 = type;
                    this.field_6 = false;
                    this.prop_3  = false;
                    bool_        = true;
                }
                else
                {
                    this.field_0 = typeof(List <>).MakeGenericType(new Type[]
                    {
                        this.prop_0
                    });
                    this.field_6 = true;
                    this.prop_3  = true;
                    bool_        = this.prop_6;
                }
            }
            else
            {
                bool_       = false;
                this.prop_3 = true;
            }
            this.prop_4 = bool_;
        }