[HttpWebRequest] EndGetResponse already does this.
[mono.git] / mcs / class / IKVM.Reflection / CustomAttributeData.cs
index 1b3216368ae7bab80085e21b6975b396ce006300..ae495c92ce298cafddcaeca7ba27bf1fc4389884 100644 (file)
@@ -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