internal static void smethod_0(XmlReader xmlReader_0, List <Class139> list_3, Worksheet worksheet_0) { if (!xmlReader_0.IsEmptyElement) { while (xmlReader_0.Read()) { if ((xmlReader_0.Name == "Names") && (xmlReader_0.NodeType == XmlNodeType.EndElement)) { break; } if ((xmlReader_0.NodeType == XmlNodeType.Element) && (xmlReader_0.Name == "NamedRange")) { Aisino.Framework.Plugin.Core.ExcelXml.Range range = null; string str = ""; foreach (XmlReaderAttributeItem item in xmlReader_0.GetAttributes()) { if ((item.LocalName == "Name") && item.HasValue) { str = item.Value; } if ((item.LocalName == "RefersTo") && item.HasValue) { range = new Aisino.Framework.Plugin.Core.ExcelXml.Range(item.Value); } } Class139 class2 = new Class139(range, str, worksheet_0); list_3.Add(class2); } } } }
private void method_7(JsonContract jsonContract_0) { JsonContainerAttribute attribute = Class139.smethod_0(jsonContract_0.type_0); if (attribute != null) { jsonContract_0.IsReference = attribute.nullable_0; } else { DataContractAttribute attribute2 = Class139.smethod_5(jsonContract_0.type_0); if ((attribute2 != null) && attribute2.IsReference) { jsonContract_0.IsReference = true; } } jsonContract_0.Converter = this.ResolveContractConverter(jsonContract_0.type_0); jsonContract_0.JsonConverter_0 = JsonSerializer.smethod_1(ilist_0, jsonContract_0.type_0); if (Class194.smethod_6(jsonContract_0.CreatedType, true) || jsonContract_0.CreatedType.smethod_12()) { jsonContract_0.DefaultCreator = this.method_6(jsonContract_0.CreatedType); jsonContract_0.DefaultCreatorNonPublic = !jsonContract_0.CreatedType.smethod_12() && (Class194.smethod_7(jsonContract_0.CreatedType) == null); } this.method_8(jsonContract_0, jsonContract_0.type_0); }
protected virtual List <MemberInfo> GetSerializableMembers(Type objectType) { bool ignoreSerializableAttribute = this.IgnoreSerializableAttribute; MemberSerialization serialization = Class139.smethod_7(objectType, ignoreSerializableAttribute); if (func_0 == null) { func_0 = new Func <MemberInfo, bool>(DefaultContractResolver.smethod_5); } List <MemberInfo> list = Class194.smethod_27(objectType, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance).Where <MemberInfo>(func_0).ToList <MemberInfo>(); List <MemberInfo> source = new List <MemberInfo>(); if (serialization != MemberSerialization.Fields) { Type type; DataContractAttribute attribute = Class139.smethod_5(objectType); if (func_1 == null) { func_1 = new Func <MemberInfo, bool>(DefaultContractResolver.smethod_6); } List <MemberInfo> list3 = Class194.smethod_27(objectType, this.DefaultMembersSearchFlags).Where <MemberInfo>(func_1).ToList <MemberInfo>(); foreach (MemberInfo info in list) { if (this.SerializeCompilerGeneratedMembers || !info.IsDefined(typeof(CompilerGeneratedAttribute), true)) { if (list3.Contains(info)) { source.Add(info); } else if (Class139.smethod_17 <JsonPropertyAttribute>(info) != null) { source.Add(info); } else if ((attribute != null) && (Class139.smethod_17 <DataMemberAttribute>(info) != null)) { source.Add(info); } else if ((serialization == MemberSerialization.Fields) && (info.smethod_1() == MemberTypes.Field)) { source.Add(info); } } } if (objectType.smethod_13("System.Data.Objects.DataClasses.EntityObject", out type)) { source = source.Where <MemberInfo>(new Func <MemberInfo, bool>(this.method_2)).ToList <MemberInfo>(); } return(source); } foreach (MemberInfo info2 in list) { FieldInfo info3 = info2 as FieldInfo; if ((info3 != null) && !info3.IsStatic) { source.Add(info2); } } return(source); }
private string method_2(Type type_0) { JsonContainerAttribute attribute = Class139.smethod_0(type_0); if ((attribute != null) && !string.IsNullOrEmpty(attribute.Title)) { return(attribute.Title); } return(null); }
// Token: 0x0600003F RID: 63 RVA: 0x00008874 File Offset: 0x00006A74 public override Class139 vmethod_3(Class139 class139_0) { base.method_1(class139_0.method_0()); int num = class139_0.vmethod_2(); if (num == 23) { this.method_3(((Class142)class139_0).method_2()); return(this); } throw new ArgumentOutOfRangeException(); }
protected virtual JsonContract CreateContract(Type objectType) { Type type = Class194.smethod_11(objectType); if (smethod_0(objectType)) { return(this.CreatePrimitiveContract(objectType)); } if (Class139.smethod_1(type) == null) { if (Class139.smethod_2(type) != null) { return(this.CreateArrayContract(objectType)); } if (Class139.smethod_3(type) != null) { return(this.CreateDictionaryContract(objectType)); } if ((type == typeof(JToken)) || type.IsSubclassOf(typeof(JToken))) { return(this.CreateLinqContract(objectType)); } if (Class191.smethod_2(type)) { return(this.CreateDictionaryContract(objectType)); } if (typeof(IEnumerable).IsAssignableFrom(type)) { return(this.CreateArrayContract(objectType)); } if (smethod_2(type)) { return(this.CreateStringContract(objectType)); } if (!this.IgnoreSerializableInterface && typeof(ISerializable).IsAssignableFrom(type)) { return(this.CreateISerializableContract(objectType)); } if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(type)) { return(this.CreateDynamicContract(objectType)); } if (smethod_1(type)) { return(this.CreatePrimitiveContract(type)); } } return(this.CreateObjectContract(objectType)); }
internal JsonContainerContract(Type underlyingType) : base(underlyingType) { JsonContainerAttribute attribute = Class139.smethod_0(underlyingType); if (attribute != null) { if (attribute.ItemConverterType != null) { this.ItemConverter = JsonConverterAttribute.smethod_0(attribute.ItemConverterType); } this.ItemIsReference = attribute.nullable_1; this.ItemReferenceLoopHandling = attribute.nullable_2; this.ItemTypeNameHandling = attribute.nullable_3; } }
private string method_3(Type type_0) { JsonContainerAttribute attribute = Class139.smethod_0(type_0); if ((attribute != null) && !string.IsNullOrEmpty(attribute.Description)) { return(attribute.Description); } DescriptionAttribute attribute2 = Class194.smethod_29 <DescriptionAttribute>(type_0); if (attribute2 != null) { return(attribute2.Description); } return(null); }
// Token: 0x06000088 RID: 136 RVA: 0x0000AAD4 File Offset: 0x00008CD4 public override Class139 vmethod_3(Class139 class139_0) { base.method_1(class139_0.method_0()); int num = class139_0.vmethod_2(); if (num != 4) { if (num != 5) { throw new ArgumentOutOfRangeException(); } this.method_3(((Class143)class139_0).method_2()); } else { this.method_3((string)((Class166)class139_0).method_2()); } return(this); }
protected virtual JsonObjectContract CreateObjectContract(Type objectType) { JsonObjectContract contract = new JsonObjectContract(objectType); this.method_7(contract); bool ignoreSerializableAttribute = this.IgnoreSerializableAttribute; contract.MemberSerialization = Class139.smethod_7(contract.type_0, ignoreSerializableAttribute); contract.Properties.smethod_1 <JsonProperty>(this.CreateProperties(contract.type_0, contract.MemberSerialization)); JsonObjectAttribute attribute = Class139.smethod_1(contract.type_0); if (attribute != null) { contract.ItemRequired = attribute.nullable_4; } ConstructorInfo constructor = this.method_4(contract.type_0); if (constructor != null) { contract.OverrideConstructor = constructor; contract.ConstructorParameters.smethod_1 <JsonProperty>(this.CreateConstructorParameters(constructor, contract.Properties)); } else if (contract.MemberSerialization == MemberSerialization.Fields) { if (Class139.Boolean_1) { contract.DefaultCreator = new Func <object>(contract.method_5); } } else if ((contract.DefaultCreator == null) || contract.DefaultCreatorNonPublic) { ConstructorInfo info2 = this.method_5(contract.type_0); if (info2 != null) { contract.ParametrizedConstructor = info2; contract.ConstructorParameters.smethod_1 <JsonProperty>(this.CreateConstructorParameters(info2, contract.Properties)); } } contract.ExtensionDataSetter = this.method_3(contract.type_0); return(contract); }
private string method_4(Type type_0, bool bool_0) { JsonContainerAttribute attribute = Class139.smethod_0(type_0); if ((attribute != null) && !string.IsNullOrEmpty(attribute.Id)) { return(attribute.Id); } if (!bool_0) { switch (this.UndefinedSchemaIdHandling) { case Newtonsoft.Json.Schema.UndefinedSchemaIdHandling.UseTypeName: return(type_0.FullName); case Newtonsoft.Json.Schema.UndefinedSchemaIdHandling.UseAssemblyQualifiedName: return(type_0.AssemblyQualifiedName); } } return(null); }
internal static TypeConverter smethod_13(Type type_0) { return(Class139.smethod_11(type_0)); }
private void method_11(JsonProperty jsonProperty_0, object object_1, string string_0, Type type_0, MemberSerialization memberSerialization_0, out bool bool_4) { DataMemberAttribute attribute2; string propertyName; DataContractAttribute attribute = Class139.smethod_5(type_0); MemberInfo info = object_1 as MemberInfo; if ((attribute != null) && (info != null)) { attribute2 = Class139.smethod_6(info); } else { attribute2 = null; } JsonPropertyAttribute attribute3 = Class139.smethod_17 <JsonPropertyAttribute>(object_1); if (attribute3 != null) { jsonProperty_0.HasMemberAttribute = true; } if ((attribute3 != null) && (attribute3.PropertyName != null)) { propertyName = attribute3.PropertyName; } else if ((attribute2 != null) && (attribute2.Name != null)) { propertyName = attribute2.Name; } else { propertyName = string_0; } jsonProperty_0.PropertyName = this.ResolvePropertyName(propertyName); jsonProperty_0.UnderlyingName = string_0; bool flag = false; if (attribute3 != null) { jsonProperty_0.nullable_0 = attribute3.nullable_7; jsonProperty_0.Order = attribute3.nullable_6; jsonProperty_0.DefaultValueHandling = attribute3.nullable_1; flag = true; } else if (attribute2 != null) { jsonProperty_0.nullable_0 = new Required?(attribute2.IsRequired ? Required.AllowNull : Required.Default); jsonProperty_0.Order = (attribute2.Order != -1) ? new int?(attribute2.Order) : null; jsonProperty_0.DefaultValueHandling = !attribute2.EmitDefaultValue ? ((DefaultValueHandling?)1) : null; flag = true; } bool flag2 = ((Class139.smethod_17 <JsonIgnoreAttribute>(object_1) != null) || (Class139.smethod_17 <JsonExtensionDataAttribute>(object_1) != null)) || (Class139.smethod_17 <NonSerializedAttribute>(object_1) != null); if (memberSerialization_0 != MemberSerialization.OptIn) { bool flag3 = false; flag3 = Class139.smethod_17 <IgnoreDataMemberAttribute>(object_1) != null; jsonProperty_0.Ignored = flag2 || flag3; } else { jsonProperty_0.Ignored = flag2 || !flag; } jsonProperty_0.Converter = Class139.smethod_10(object_1, jsonProperty_0.PropertyType); jsonProperty_0.MemberConverter = Class139.smethod_10(object_1, jsonProperty_0.PropertyType); DefaultValueAttribute attribute4 = Class139.smethod_17 <DefaultValueAttribute>(object_1); if (attribute4 != null) { jsonProperty_0.DefaultValue = attribute4.Value; } jsonProperty_0.NullValueHandling = (attribute3 != null) ? attribute3.nullable_0 : null; jsonProperty_0.ReferenceLoopHandling = (attribute3 != null) ? attribute3.nullable_2 : null; jsonProperty_0.ObjectCreationHandling = (attribute3 != null) ? attribute3.nullable_3 : null; jsonProperty_0.TypeNameHandling = (attribute3 != null) ? attribute3.nullable_4 : null; jsonProperty_0.IsReference = (attribute3 != null) ? attribute3.nullable_5 : null; jsonProperty_0.ItemIsReference = (attribute3 != null) ? attribute3.nullable_8 : null; jsonProperty_0.ItemConverter = ((attribute3 == null) || (attribute3.ItemConverterType == null)) ? null : JsonConverterAttribute.smethod_0(attribute3.ItemConverterType); jsonProperty_0.ItemReferenceLoopHandling = (attribute3 != null) ? attribute3.nullable_9 : null; jsonProperty_0.ItemTypeNameHandling = (attribute3 != null) ? attribute3.nullable_10 : null; bool_4 = false; if ((this.DefaultMembersSearchFlags & BindingFlags.NonPublic) == BindingFlags.NonPublic) { bool_4 = true; } if (attribute3 != null) { bool_4 = true; } if (memberSerialization_0 == MemberSerialization.Fields) { bool_4 = true; } if (attribute2 != null) { bool_4 = true; jsonProperty_0.HasMemberAttribute = true; } }
// Token: 0x06000032 RID: 50 RVA: 0x00008364 File Offset: 0x00006564 public override Class139 vmethod_3(Class139 class139_0) { base.method_1(class139_0.method_0()); switch (class139_0.vmethod_2()) { case 0: this.method_3((short)((Class159)class139_0).method_2()); return(this); case 2: this.method_3((short)Convert.ToByte(((Class144)class139_0).method_2())); return(this); case 4: this.method_3(Convert.ToInt16(((Class166)class139_0).method_2())); return(this); case 7: this.method_3((short)((Class145)class139_0).method_2()); return(this); case 9: this.method_3((short)((Class161)class139_0).method_2()); return(this); case 10: this.method_3((short)((Class162)class139_0).method_2()); return(this); case 11: this.method_3((short)((Class156)class139_0).method_2()); return(this); case 14: this.method_3((short)((int)((Class146)class139_0).method_2())); return(this); case 15: this.method_3(((Class141)class139_0).method_2()); return(this); case 17: this.method_3((short)((Class158)class139_0).method_2()); return(this); case 19: this.method_3((short)((Class165)class139_0).method_2()); return(this); case 21: this.method_3((short)((Class163)class139_0).method_2()); return(this); case 22: this.method_3((short)((Class164)class139_0).method_2()); return(this); case 24: this.method_3(Convert.ToInt16(((Class160)class139_0).method_2())); return(this); } throw new ArgumentOutOfRangeException(); }
protected virtual JsonConverter ResolveContractConverter(Type objectType) { return(Class139.smethod_10(objectType, objectType)); }
public abstract void Visit(Class139 c);
public override void Visit(Class139 c) { }
// Token: 0x06000663 RID: 1635 public abstract Class139 vmethod_3(Class139 class139_0);
private JsonSchema method_5(Type type_0, Required required_0, bool bool_0) { JsonConverter converter; Class134 class4 = new Class134 { type_0 = type_0 }; Class203.smethod_2(class4.type_0, "type"); string str = this.method_4(class4.type_0, false); string str2 = this.method_4(class4.type_0, true); if (!string.IsNullOrEmpty(str)) { JsonSchema schema = this.jsonSchemaResolver_0.GetSchema(str); if (schema != null) { if ((required_0 != Required.Always) && !smethod_0(schema.Type, JsonSchemaType.Null)) { schema.Type = ((JsonSchemaType)schema.Type) | JsonSchemaType.Null; } if (bool_0 && (schema.Required != true)) { schema.Required = true; } return(schema); } } if (this.ilist_0.Any <Class133>(new Func <Class133, bool>(class4.method_0))) { throw new JsonException("Unresolved circular reference for type '{0}'. Explicitly define an Id for the type using a JsonObject/JsonArray attribute or automatically generate a type Id using the UndefinedSchemaIdHandling property.".smethod_0(CultureInfo.InvariantCulture, class4.type_0)); } JsonContract contract = this.ContractResolver.ResolveContract(class4.type_0); if (((converter = contract.Converter) != null) || ((converter = contract.JsonConverter_0) != null)) { JsonSchema schema2 = converter.GetSchema(); if (schema2 != null) { return(schema2); } } this.method_0(new Class133(class4.type_0, new JsonSchema())); if (str2 != null) { this.JsonSchema_0.Id = str2; } if (bool_0) { this.JsonSchema_0.Required = true; } this.JsonSchema_0.Title = this.method_2(class4.type_0); this.JsonSchema_0.Description = this.method_3(class4.type_0); if (converter != null) { this.JsonSchema_0.Type = 0x7f; } else { switch (contract.enum15_0) { case Enum15.Object: this.JsonSchema_0.Type = new JsonSchemaType?(this.method_6(JsonSchemaType.Object, required_0)); this.JsonSchema_0.Id = this.method_4(class4.type_0, false); this.method_8(class4.type_0, (JsonObjectContract)contract); goto Label_04CD; case Enum15.Array: { this.JsonSchema_0.Type = new JsonSchemaType?(this.method_6(JsonSchemaType.Array, required_0)); this.JsonSchema_0.Id = this.method_4(class4.type_0, false); JsonArrayAttribute attribute = Class139.smethod_0(class4.type_0) as JsonArrayAttribute; bool flag = (attribute == null) || attribute.AllowNullItems; Type type = Class194.smethod_18(class4.type_0); if (type != null) { this.JsonSchema_0.Items = new List <JsonSchema>(); this.JsonSchema_0.Items.Add(this.method_5(type, !flag ? Required.Always : Required.Default, false)); } goto Label_04CD; } case Enum15.Primitive: this.JsonSchema_0.Type = new JsonSchemaType?(this.method_10(class4.type_0, required_0)); if (((((JsonSchemaType)this.JsonSchema_0.Type) == JsonSchemaType.Integer) && class4.type_0.smethod_7()) && !class4.type_0.IsDefined(typeof(FlagsAttribute), true)) { this.JsonSchema_0.Enum = new List <JToken>(); foreach (Class187 <long> class3 in Class186.smethod_2 <long>(class4.type_0)) { JToken item = JToken.FromObject(class3.Prop_0); this.JsonSchema_0.Enum.Add(item); } } goto Label_04CD; case Enum15.String: { JsonSchemaType type2 = !Class194.smethod_9(contract.UnderlyingType) ? JsonSchemaType.String : this.method_6(JsonSchemaType.String, required_0); this.JsonSchema_0.Type = new JsonSchemaType?(type2); goto Label_04CD; } case Enum15.Dictionary: Type type3; Type type4; this.JsonSchema_0.Type = new JsonSchemaType?(this.method_6(JsonSchemaType.Object, required_0)); Class194.smethod_19(class4.type_0, out type3, out type4); if ((type3 != null) && (this.ContractResolver.ResolveContract(type3).enum15_0 == Enum15.Primitive)) { this.JsonSchema_0.AdditionalProperties = this.method_5(type4, Required.Default, false); } goto Label_04CD; case Enum15.Dynamic: case Enum15.Linq: this.JsonSchema_0.Type = 0x7f; goto Label_04CD; case Enum15.Serializable: this.JsonSchema_0.Type = new JsonSchemaType?(this.method_6(JsonSchemaType.Object, required_0)); this.JsonSchema_0.Id = this.method_4(class4.type_0, false); this.method_9(class4.type_0, (JsonISerializableContract)contract); goto Label_04CD; } throw new JsonException("Unexpected contract type: {0}".smethod_0(CultureInfo.InvariantCulture, contract)); } Label_04CD: return(this.method_1().JsonSchema_0); }
// Token: 0x060004E5 RID: 1253 RVA: 0x00028164 File Offset: 0x00026364 public static Class139 smethod_1(object object_0, Type type_0) { Class139 @class = object_0 as Class139; if (@class != null) { return(@class); } if (type_0 == null) { if (object_0 == null) { return(new Class166()); } type_0 = object_0.GetType(); } type_0 = Class102.smethod_1(type_0); if (type_0 == Class28.type_0) { @class = new Class166(); if (object_0 != null && object_0.GetType() != Class28.type_0) { @class.method_1(object_0.GetType()); } } else if (Class99.smethod_0 <Array>(type_0)) { @class = new Class140(); } else if (Class99.smethod_0 <string>(type_0)) { @class = new Class143(); } else if (Class99.smethod_0 <IntPtr>(type_0)) { @class = new Class146(); } else if (Class99.smethod_0 <UIntPtr>(type_0)) { @class = new Class157(); } else if (Class99.smethod_0 <ulong>(type_0)) { @class = new Class165(); } else if (Class99.smethod_0 <uint>(type_0)) { @class = new Class163(); } else if (Class99.smethod_0 <ushort>(type_0)) { @class = new Class159(); } else if (Class99.smethod_0 <long>(type_0)) { @class = new Class156(); } else if (Class99.smethod_0 <int>(type_0)) { @class = new Class145(); } else if (Class99.smethod_0 <short>(type_0)) { @class = new Class141(); } else if (Class99.smethod_0 <byte>(type_0)) { @class = new Class164(); } else if (Class99.smethod_0 <sbyte>(type_0)) { @class = new Class161(); } else if (Class99.smethod_0 <double>(type_0)) { @class = new Class158(); } else if (Class99.smethod_0 <float>(type_0)) { @class = new Class162(); } else if (Class99.smethod_0 <bool>(type_0)) { @class = new Class144(); } else if (Class99.smethod_0 <char>(type_0)) { @class = new Class155(); } else if (Class28.smethod_0(type_0)) { Class166 class2 = new Class166(); class2.method_1(type_0); @class = class2; } else { if (Class99.smethod_0 <Enum>(type_0)) { Enum enum_; if (object_0 == null) { if (type_0 == Class28.type_2) { enum_ = null; } else { enum_ = (Enum)Activator.CreateInstance(type_0); } } else if (type_0 == Class28.type_2 && object_0 is Enum) { enum_ = (Enum)object_0; } else { enum_ = (Enum)Enum.ToObject(type_0, object_0); } return(new Class160(enum_)); } if (Class99.smethod_0 <ValueType>(type_0)) { if (object_0 == null) { object object_; if (type_0 == Class28.type_3) { object_ = null; } else { object_ = Activator.CreateInstance(type_0); } @class = new Class154(object_); } else { if (object_0.GetType() != type_0) { try { object_0 = Convert.ChangeType(object_0, type_0); } catch { } } @class = new Class154(object_0); } return(@class); } @class = new Class166(); } if (object_0 != null) { @class.vmethod_1(object_0); } return(@class); }