25using System.Collections.Generic;
41 public sealed override MemberTypes MemberType => MemberTypes.Property;
43 public abstract PropertyAttributes Attributes {
get; }
45 public abstract bool CanRead {
get; }
47 public abstract bool CanWrite {
get; }
49 public abstract MethodInfo GetGetMethod(
bool nonPublic);
51 public abstract MethodInfo GetSetMethod(
bool nonPublic);
53 public abstract MethodInfo[] GetAccessors(
bool nonPublic);
55 public abstract object GetRawConstantValue();
57 internal abstract bool IsPublic {
get; }
59 internal abstract bool IsNonPrivate {
get; }
61 internal abstract bool IsStatic {
get; }
63 internal abstract PropertySignature PropertySignature {
get; }
69 readonly
int parameter;
76 internal ParameterInfoImpl(
PropertyInfo property,
int parameter)
78 this.property = property;
79 this.parameter = parameter;
82 public override string Name
87 public override Type ParameterType
89 get {
return property.PropertySignature.GetParameter(parameter); }
92 public override ParameterAttributes Attributes
94 get {
return ParameterAttributes.None; }
97 public override int Position
99 get {
return parameter; }
102 public override object RawDefaultValue
104 get {
throw new InvalidOperationException(); }
107 public override CustomModifiers __GetCustomModifiers()
109 return property.PropertySignature.GetParameterCustomModifiers(parameter);
112 public override bool __TryGetFieldMarshal(out FieldMarshal fieldMarshal)
114 fieldMarshal =
new FieldMarshal();
120 get {
return property; }
123 public override int MetadataToken
125 get {
return 0x08000000; }
130 get {
return property.Module; }
137 var parameters =
new ParameterInfo[PropertySignature.ParameterCount];
138 for (var i = 0; i < parameters.Length; i++)
139 parameters[i] =
new ParameterInfoImpl(
this, i);
144 public Type PropertyType
146 get {
return PropertySignature.PropertyType; }
149 public CustomModifiers __GetCustomModifiers()
151 return PropertySignature.GetCustomModifiers();
154 public Type[] GetRequiredCustomModifiers()
156 return __GetCustomModifiers().GetRequired();
159 public Type[] GetOptionalCustomModifiers()
161 return __GetCustomModifiers().GetOptional();
164 public bool IsSpecialName
166 get {
return (Attributes & PropertyAttributes.SpecialName) != 0; }
171 get {
return GetGetMethod(
true); }
176 get {
return GetSetMethod(
true); }
181 return GetGetMethod(
false);
186 return GetSetMethod(
false);
191 return GetAccessors(
false);
194 public CallingConventions __CallingConvention
196 get {
return this.PropertySignature.CallingConvention; }
201 return new GenericPropertyInfo(this.DeclaringType.BindTypeParameters(type),
this);
204 public override string ToString()
206 return DeclaringType.ToString() +
" " +
Name;
209 internal sealed override bool BindingFlagsMatch(BindingFlags flags)
211 return BindingFlagsMatch(IsPublic, flags, BindingFlags.Public, BindingFlags.NonPublic)
212 && BindingFlagsMatch(IsStatic, flags, BindingFlags.Static, BindingFlags.Instance);
215 internal sealed override bool BindingFlagsMatchInherited(BindingFlags flags)
218 && BindingFlagsMatch(IsPublic, flags, BindingFlags.Public, BindingFlags.NonPublic)
219 && BindingFlagsMatch(IsStatic, flags, BindingFlags.Static | BindingFlags.FlattenHierarchy, BindingFlags.Instance);
224 return new PropertyInfoWithReflectedType(type,
this);
227 internal sealed override List<CustomAttributeData> GetPseudoCustomAttributes(
Type attributeType)
IKVM.Reflection.Module Module
IKVM.Reflection.Type Type
IKVM.Reflection.MemberInfo MemberInfo
IKVM.Reflection.PropertyInfo PropertyInfo
IKVM.Reflection.MethodInfo MethodInfo
IKVM.Reflection.ParameterInfo ParameterInfo
global::java.lang.invoke.LambdaForm.Name Name