X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FIKVM.Reflection%2FCustomAttributeData.cs;h=ae495c92ce298cafddcaeca7ba27bf1fc4389884;hb=6450a342e599538aca2db79f3543fdb00cfbc6ce;hp=1b3216368ae7bab80085e21b6975b396ce006300;hpb=a9be3295aca251f07a36763e0ab57c18f15b7910;p=mono.git diff --git a/mcs/class/IKVM.Reflection/CustomAttributeData.cs b/mcs/class/IKVM.Reflection/CustomAttributeData.cs index 1b3216368ae..ae495c92ce2 100644 --- a/mcs/class/IKVM.Reflection/CustomAttributeData.cs +++ b/mcs/class/IKVM.Reflection/CustomAttributeData.cs @@ -381,41 +381,9 @@ namespace IKVM.Reflection return null; } - public bool __TryReadTypeName(out string ns, out string name) + [Obsolete("Use Constructor.DeclaringType instead.")] + internal bool __TryReadTypeName(out string ns, out string name) { - if (lazyConstructor == null) - { - ModuleReader mod = module as ModuleReader; - if (mod != null) - { - // Note that we only need to manually handle the MemberRef case here, - // because a MethodDef will result in a lazy MethodInfo object being returned - // when the constructor is resolved, so we can safely do that without - // triggering an assembly load. - int methodToken = mod.CustomAttribute.records[index].Type; - if ((methodToken >> 24) == MemberRefTable.Index) - { - int methodIndex = (methodToken & 0xFFFFFF) - 1; - int typeToken = mod.MemberRef.records[methodIndex].Class; - if ((typeToken >> 24) == TypeRefTable.Index) - { - int typeIndex = (typeToken & 0xFFFFFF) - 1; - if ((mod.TypeRef.records[typeIndex].ResolutionScope >> 24) == TypeRefTable.Index) - { - // nested types can't be represented using only a namespace and name, - // so we fail - ns = null; - name = null; - return false; - } - int typeNameSpace = mod.TypeRef.records[typeIndex].TypeNameSpace; - ns = typeNameSpace == 0 ? null : mod.GetString(typeNameSpace); - name = mod.GetString(mod.TypeRef.records[typeIndex].TypeName); - return true; - } - } - } - } if (Constructor.DeclaringType.IsNested) { ns = null; @@ -427,6 +395,12 @@ namespace IKVM.Reflection return true; } + // for use by mcs + internal byte[] __GetBlob() + { + return ((ModuleReader)module).GetBlobCopy(module.CustomAttribute.records[index].Value); + } + public ConstructorInfo Constructor { get