public static TypeDesc Get(Type type, Resolver resolver) { Requires.NotNull(type, nameof(type)); Requires.NotNull(resolver, nameof(resolver)); return(new TypeDesc(TypeRef.Get(type, resolver), type.FullName)); }
public PropertyRef(PropertyInfo propertyInfo, Resolver resolver) : base(propertyInfo, resolver) { this.getMethodMetadataToken = propertyInfo.GetMethod?.MetadataToken; this.setMethodMetadataToken = propertyInfo.SetMethod?.MetadataToken; this.Name = propertyInfo.Name; this.PropertyTypeRef = TypeRef.Get(propertyInfo.PropertyType, resolver); }
public PropertyRef(PropertyInfo propertyInfo, Resolver resolver) : this() { this.DeclaringType = TypeRef.Get(propertyInfo.DeclaringType, resolver); this.metadataToken = propertyInfo.MetadataToken; this.propertyInfo = propertyInfo; this.Name = propertyInfo.Name; }
public PropertyRef(PropertyInfo propertyInfo, Resolver resolver) : this() { this.DeclaringType = TypeRef.Get(propertyInfo.DeclaringType, resolver); this.MetadataToken = propertyInfo.MetadataToken; this.GetMethodMetadataToken = propertyInfo.GetMethod != null ? (int?)propertyInfo.GetMethod.MetadataToken : null; this.SetMethodMetadataToken = propertyInfo.SetMethod != null ? (int?)propertyInfo.SetMethod.MetadataToken : null; }
public MethodRef(MethodBase method, Resolver resolver, ImmutableArray <TypeRef> parameterTypes) : this() { Requires.NotNull(method, nameof(method)); Requires.NotNull(resolver, nameof(resolver)); this.DeclaringType = TypeRef.Get(method.DeclaringType, resolver); this.ParameterTypes = parameterTypes; this.Name = method.Name; this.GenericMethodArguments = method.GetGenericTypeArguments(resolver); this.methodBase = method; }
public MemberRef(MemberInfo member, Resolver resolver) : this() { Requires.NotNull(member, nameof(member)); switch (member.MemberType) { case MemberTypes.Constructor: this.Constructor = new ConstructorRef((ConstructorInfo)member, resolver); break; case MemberTypes.Field: this.Field = new FieldRef((FieldInfo)member, resolver); break; case MemberTypes.Method: this.Method = new MethodRef((MethodInfo)member, resolver); break; case MemberTypes.Property: this.Property = new PropertyRef((PropertyInfo)member, resolver); break; default: if (member is TypeInfo typeInfo) { this.Type = TypeRef.Get(typeInfo.AsType(), resolver); } else { throw new NotSupportedException(); } break; } }
public ConstructorRef(ConstructorInfo constructor, Resolver resolver) : this(TypeRef.Get(constructor.DeclaringType, resolver), constructor.MetadataToken, constructor.GetParameterTypes(resolver)) { }
public FieldRef(FieldInfo field, Resolver resolver) : base(field, resolver) { this.Name = field.Name; this.FieldTypeRef = TypeRef.Get(field.FieldType, resolver); }
protected MemberRef(MemberInfo memberInfo, Resolver resolver) : this( TypeRef.Get(Requires.NotNull(memberInfo, nameof(memberInfo)).DeclaringType, resolver), memberInfo) { }
public FieldRef(FieldInfo field, Resolver resolver) : this(TypeRef.Get(field.DeclaringType, resolver), field.MetadataToken) { }
public MethodRef(MethodInfo method, Resolver resolver) : this(TypeRef.Get(method.DeclaringType, resolver), method.MetadataToken, method.Name, method.GetParameterTypes(resolver), method.GetGenericTypeArguments(resolver)) { }
public ParameterRef(ParameterInfo parameter, Resolver resolver) : this(TypeRef.Get(parameter.Member.DeclaringType, resolver), parameter.Member.MetadataToken, parameter.Position) { }
public MethodRef(MethodInfo method, Resolver resolver) : this(TypeRef.Get(method.DeclaringType, resolver), method.MetadataToken, method.GetGenericArguments().Select(t => TypeRef.Get(t, resolver)).ToImmutableArray()) { }