26using System.Collections.Generic;
33#pragma warning disable 660, 661
34 internal abstract class MemberInfo : ICustomAttributeProvider
45 public abstract string Name {
get; }
47 public abstract Type DeclaringType {
get; }
49 public abstract MemberTypes MemberType {
get; }
51 public virtual Type ReflectedType
53 get {
return DeclaringType; }
58 public virtual int MetadataToken
60 get {
throw new NotSupportedException(); }
68 public virtual bool __IsMissing
73 public bool IsDefined(
Type attributeType,
bool inherit)
75 return CustomAttributeData.__GetCustomAttributes(
this, attributeType, inherit).Count != 0;
78 public IList<CustomAttributeData> __GetCustomAttributes(
Type attributeType,
bool inherit)
80 return CustomAttributeData.__GetCustomAttributes(
this, attributeType, inherit);
83 public IList<CustomAttributeData> GetCustomAttributesData()
85 return CustomAttributeData.GetCustomAttributes(
this);
88 public IEnumerable<CustomAttributeData> CustomAttributes
90 get {
return GetCustomAttributesData(); }
95 return ReferenceEquals(m1, m2) || (!ReferenceEquals(m1,
null) && m1.Equals(m2));
103 internal abstract int GetCurrentToken();
105 internal abstract List<CustomAttributeData> GetPseudoCustomAttributes(
Type attributeType);
107 internal abstract bool IsBaked {
get; }
109 internal virtual bool BindingFlagsMatch(BindingFlags flags)
111 throw new InvalidOperationException();
114 internal virtual bool BindingFlagsMatchInherited(BindingFlags flags)
116 throw new InvalidOperationException();
119 protected static bool BindingFlagsMatch(
bool state, BindingFlags flags, BindingFlags trueFlag, BindingFlags falseFlag)
121 return (state && (flags & trueFlag) == trueFlag) || (!state && (flags & falseFlag) == falseFlag);
124 protected static T SetReflectedType<T>(T member,
Type type)
127 return member ==
null ? null : (T)member.SetReflectedType(type);
130 protected static T[] SetReflectedType<T>(T[] members,
Type type)
133 for (
int i = 0; i < members.Length; i++)
134 members[i] = SetReflectedType(members[i], type);
IKVM.Reflection.Module Module
IKVM.Reflection.Type Type
IKVM.Reflection.MemberInfo MemberInfo
global::java.lang.invoke.LambdaForm.Name Name