public SharpAssemblyReturnType(SharpAssembly_ assembly, TypeRef[] typeRefTable, uint index)
 {
     underlyingClass = SharpAssemblyClass.FromTypeRef(assembly, index);
     if (underlyingClass != null) {
         FullyQualifiedName = underlyingClass.FullyQualifiedName;
     } else {
         FullyQualifiedName = assembly.Reader.GetStringFromHeap(typeRefTable[index].Nspace) + "." +
                                                     assembly.Reader.GetStringFromHeap(typeRefTable[index].Name);
         Runtime.LoggingService.Info("SharpAssemblyReturnType from TypeRef: TypeRef not resolved!");
     }
     declaredin = assembly.GetRefAssemblyFor(index);
 }
        public static string GetNestedName(SharpAssembly_ asm, TypeRef[] typeRefTable, uint index)
        {
            uint val = typeRefTable[index].ResolutionScope;
            int table = asm.Reader.GetCodedIndexTable(CodedIndex.ResolutionScope, ref val);

            switch (table) {
                case 2: // AssemblyRef
                    return asm.Reader.GetStringFromHeap(typeRefTable[index].Nspace) + "." + asm.Reader.GetStringFromHeap(typeRefTable[index].Name);
                case 3: // TypeRef -- nested type
                    return GetNestedName(asm, typeRefTable, val) + "+" + asm.Reader.GetStringFromHeap(typeRefTable[index].Name);
                default: // other token - not supported
                    Runtime.LoggingService.Info("GetNestedName: Unsupported resolution scope!");
                    goto case 3;
            }
        }