コード例 #1
0
ファイル: FieldReference.cs プロジェクト: 542767059/ABC
        public FieldReference(string name, TypeReference fieldType)
            : base(name)
        {
            Mixin.CheckType(fieldType, Mixin.Argument.fieldType);

            this.field_type = fieldType;
            this.token      = new MetadataToken(TokenType.MemberRef);
        }
コード例 #2
0
ファイル: Import.cs プロジェクト: 542767059/ABC
 public virtual TypeReference ImportReference(Type type, IGenericParameterProvider context)
 {
     Mixin.CheckType(type);
     return(ImportType(
                type,
                ImportGenericContext.For(context),
                context != null ? ImportGenericKind.Open : ImportGenericKind.Definition));
 }
コード例 #3
0
        public MethodReference(string name, TypeReference returnType)
            : base(name)
        {
            Mixin.CheckType(returnType, Mixin.Argument.returnType);

            this.return_type            = new MethodReturnType(this);
            this.return_type.ReturnType = returnType;
            this.token = new MetadataToken(TokenType.MemberRef);
        }
コード例 #4
0
ファイル: Modifiers.cs プロジェクト: 542767059/ABC
 public OptionalModifierType(TypeReference modifierType, TypeReference type)
     : base(type)
 {
     if (modifierType == null)
     {
         throw new ArgumentNullException(Mixin.Argument.modifierType.ToString());
     }
     Mixin.CheckType(type);
     this.modifier_type = modifierType;
     this.etype         = MD.ElementType.CModOpt;
 }
コード例 #5
0
ファイル: ModuleDefinition.cs プロジェクト: wuxiongbin/XIL
		public TypeReference ImportReference (TypeReference type, IGenericParameterProvider context)
		{
			Mixin.CheckType (type);

			if (type.Module == this)
				return type;

			CheckContext (context, this);

			return MetadataImporter.ImportReference (type, context);
		}
コード例 #6
0
ファイル: ArrayType.cs プロジェクト: zwinter/ET
        public ArrayType(TypeReference type, int rank)
            : this(type)
        {
            Mixin.CheckType(type);

            if (rank == 1)
            {
                return;
            }

            dimensions = new Collection <ArrayDimension> (rank);
            for (int i = 0; i < rank; i++)
            {
                dimensions.Add(new ArrayDimension());
            }
            this.etype = MD.ElementType.Array;
        }
コード例 #7
0
        public virtual TypeDefinition Resolve(TypeReference type)
        {
            Mixin.CheckType(type);

            type = type.GetElementType();

            var scope = type.Scope;

            if (scope == null)
            {
                return(null);
            }

            switch (scope.MetadataScopeType)
            {
            case MetadataScopeType.AssemblyNameReference:
                var assembly = assembly_resolver.Resolve((AssemblyNameReference)scope);
                if (assembly == null)
                {
                    return(null);
                }

                return(GetType(assembly.MainModule, type));

            case MetadataScopeType.ModuleDefinition:
                return(GetType((ModuleDefinition)scope, type));

            case MetadataScopeType.ModuleReference:
                var modules    = type.Module.Assembly.Modules;
                var module_ref = (ModuleReference)scope;
                for (int i = 0; i < modules.Count; i++)
                {
                    var netmodule = modules [i];
                    if (netmodule.Name == module_ref.Name)
                    {
                        return(GetType(netmodule, type));
                    }
                }
                break;
            }

            throw new NotSupportedException();
        }
コード例 #8
0
 public ByReferenceType(TypeReference type)
     : base(type)
 {
     Mixin.CheckType(type);
     this.etype = MD.ElementType.ByRef;
 }
コード例 #9
0
ファイル: EventReference.cs プロジェクト: wuxiongbin/XIL
 protected EventReference(string name, TypeReference eventType)
     : base(name)
 {
     Mixin.CheckType(eventType, Mixin.Argument.eventType);
     event_type = eventType;
 }
コード例 #10
0
ファイル: Import.cs プロジェクト: 91JiaoTeacher/ETLearn_V5.0
 public virtual TypeReference ImportReference(TypeReference type, IGenericParameterProvider context)
 {
     Mixin.CheckType(type);
     return(ImportType(type, ImportGenericContext.For(context)));
 }
コード例 #11
0
 public PointerType(TypeReference type)
     : base(type)
 {
     Mixin.CheckType(type);
     this.etype = MD.ElementType.Ptr;
 }
コード例 #12
0
ファイル: ArrayType.cs プロジェクト: zwinter/ET
 public ArrayType(TypeReference type)
     : base(type)
 {
     Mixin.CheckType(type);
     this.etype = MD.ElementType.Array;
 }
コード例 #13
0
 public SentinelType(TypeReference type)
     : base(type)
 {
     Mixin.CheckType(type);
     this.etype = MD.ElementType.Sentinel;
 }
コード例 #14
0
 public PinnedType(TypeReference type)
     : base(type)
 {
     Mixin.CheckType(type);
     this.etype = MD.ElementType.Pinned;
 }
コード例 #15
0
 public CustomAttributeArgument(TypeReference type, object value)
 {
     Mixin.CheckType(type);
     this.type  = type;
     this.value = value;
 }