Пример #1
0
        protected ImportedMember(ImportedModule module, StringHandle nameHandle, ImportedType declaringType)
        {
            Module        = module;
            DeclaringType = declaringType;

            _nameHandle = nameHandle;
        }
Пример #2
0
        internal ImportedType ResolveType(TypeDefinitionHandle handle)
        {
            ImportedType type;

            if (!_resolvedTypes.TryGetValue(handle, out type))
            {
                TypeDefinition typeDef = _reader.GetTypeDefinition(handle);
                type = new ImportedType(this, typeDef);
                _resolvedTypes.Add(handle, type);
            }

            return(type);
        }
Пример #3
0
        internal ImportedMethod ResolveMethod(MethodDefinitionHandle handle, ImportedType declaringType = null)
        {
            ImportedMethod method;

            if (!_resolvedMethods.TryGetValue(handle, out method))
            {
                MethodDefinition methodDef = _reader.GetMethodDefinition(handle);
                if (declaringType == null)
                {
                    declaringType = ResolveType(methodDef.GetDeclaringType());
                }
                var name    = methodDef.Name;
                var strName = this.Reader.GetString(name);
                method = new ImportedMethod(this, methodDef, declaringType);
                _resolvedMethods.Add(handle, method);
            }

            return(method);
        }
Пример #4
0
 internal ImportedField(ImportedModule module, FieldDefinition fieldDef, ImportedType declaringType)
     : base(module, fieldDef.Name, declaringType)
 {
     _fieldDef = fieldDef;
 }
Пример #5
0
 internal ImportedMethod(ImportedModule module, MethodDefinition methodDef, ImportedType declaringType)
     : base(module, methodDef.Name, declaringType)
 {
     _methodDef = methodDef;
     _signature = methodDef.DecodeSignature(Module.XSharpTypeProvider, genericContext: null);
 }