// Token: 0x060015AF RID: 5551 RVA: 0x0006739C File Offset: 0x0006559C private static T GetAttribute <T>(Type type) where T : Attribute { Type associatedMetadataType = Class_470.GetAssociatedMetadataType(type); T attribute; if (associatedMetadataType != null) { attribute = Class_514.GetAttribute <T>(associatedMetadataType, true); if (attribute != null) { return(attribute); } } attribute = Class_514.GetAttribute <T>(type, true); if (attribute != null) { return(attribute); } foreach (Type attributeProvider in type.GetInterfaces()) { attribute = Class_514.GetAttribute <T>(attributeProvider, true); if (attribute != null) { return(attribute); } } return(default(T)); }
// Token: 0x060015A9 RID: 5545 RVA: 0x00067234 File Offset: 0x00065434 public static Class_299 GetJsonConverter(object attributeProvider) { Class_378 cachedAttribute = Class_470.GetCachedAttribute <Class_378>(attributeProvider); if (cachedAttribute != null) { Func <object[], Class_299> func = Class_470.JsonConverterCreatorCache.Get(cachedAttribute.ConverterType); if (func != null) { return(func(cachedAttribute.ConverterParameters)); } } return(null); }
// Token: 0x06000D3F RID: 3391 RVA: 0x00048108 File Offset: 0x00046308 internal Class_350(Type arg_0) : base(arg_0) { Class_316 cachedAttribute = Class_470.GetCachedAttribute <Class_316>(arg_0); if (cachedAttribute != null) { if (cachedAttribute.prop_3 != null) { this.prop_2 = Class_470.CreateJsonConverterInstance(cachedAttribute.prop_3, cachedAttribute.prop_4); } this.prop_3 = cachedAttribute.field_1; this.prop_4 = cachedAttribute.field_2; this.prop_5 = cachedAttribute.field_3; } }
// Token: 0x060015B1 RID: 5553 RVA: 0x00067510 File Offset: 0x00065710 public static T GetAttribute <T>(object provider) where T : Attribute { Type type = provider as Type; if (type != null) { return(Class_470.GetAttribute <T>(type)); } MemberInfo memberInfo = provider as MemberInfo; if (memberInfo != null) { return(Class_470.GetAttribute <T>(memberInfo)); } return(Class_514.GetAttribute <T>(provider, true)); }
// Token: 0x0600154D RID: 5453 RVA: 0x000657F0 File Offset: 0x000639F0 internal static bool gmethod_3913(object obje_0, Type arg_0, out string arg_1) { TypeConverter typeConverter = Class_470.GetTypeConverter(arg_0); if (typeConverter != null && !(typeConverter is ComponentConverter) && typeConverter.GetType() != typeof(TypeConverter) && typeConverter.CanConvertTo(typeof(string))) { arg_1 = typeConverter.ConvertToInvariantString(obje_0); return(true); } if (obje_0 is Type) { arg_1 = ((Type)obje_0).AssemblyQualifiedName; return(true); } arg_1 = null; return(false); }
// Token: 0x060015B0 RID: 5552 RVA: 0x00067430 File Offset: 0x00065630 private static T GetAttribute <T>(MemberInfo memberInfo) where T : Attribute { Type associatedMetadataType = Class_470.GetAssociatedMetadataType(memberInfo.DeclaringType); T attribute; if (associatedMetadataType != null) { MemberInfo memberInfoFromType = Class_514.GetMemberInfoFromType(associatedMetadataType, memberInfo); if (memberInfoFromType != null) { attribute = Class_514.GetAttribute <T>(memberInfoFromType, true); if (attribute != null) { return(attribute); } } } attribute = Class_514.GetAttribute <T>(memberInfo, true); if (attribute != null) { return(attribute); } if (memberInfo.DeclaringType != null) { foreach (Type targetType in memberInfo.DeclaringType.GetInterfaces()) { MemberInfo memberInfoFromType2 = Class_514.GetMemberInfoFromType(targetType, memberInfo); if (memberInfoFromType2 != null) { attribute = Class_514.GetAttribute <T>(memberInfoFromType2, true); if (attribute != null) { return(attribute); } } } } return(default(T)); }
// Token: 0x060015A8 RID: 5544 RVA: 0x000671EC File Offset: 0x000653EC public static Class_383 GetObjectMemberSerialization(Type objectType, bool ignoreSerializableAttribute) { Class_379 cachedAttribute = Class_470.GetCachedAttribute <Class_379>(objectType); if (cachedAttribute != null) { return(cachedAttribute.MemberSerialization); } DataContractAttribute dataContractAttribute = Class_470.GetDataContractAttribute(objectType); if (dataContractAttribute != null) { return(Class_383.OptIn); } if (!ignoreSerializableAttribute) { SerializableAttribute cachedAttribute2 = Class_470.GetCachedAttribute <SerializableAttribute>(objectType); if (cachedAttribute2 != null) { return(Class_383.Fields); } } return(Class_383.OptOut); }