Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MemberInfo.cs
Go to the documentation of this file.
3
4namespace System.Reflection;
5
6public abstract class MemberInfo : ICustomAttributeProvider
7{
8 public abstract MemberTypes MemberType { get; }
9
10 public abstract string Name { get; }
11
12 public abstract Type? DeclaringType { get; }
13
14 public abstract Type? ReflectedType { get; }
15
16 public virtual Module Module
17 {
18 get
19 {
20 if (this is Type type)
21 {
22 return type.Module;
23 }
25 }
26 }
27
29
30 public virtual bool IsCollectible => true;
31
32 public virtual int MetadataToken
33 {
34 get
35 {
36 throw new InvalidOperationException();
37 }
38 }
39
40 internal virtual bool CacheEquals(object o)
41 {
42 throw new NotImplementedException();
43 }
44
46 {
47 if ((object)other == null)
48 {
49 throw new ArgumentNullException("other");
50 }
51 if (!(other is TOther))
52 {
53 return false;
54 }
56 {
57 return false;
58 }
59 if (!Module.Equals(other.Module))
60 {
61 return false;
62 }
63 return true;
64 }
65
67 {
69 }
70
71 public abstract bool IsDefined(Type attributeType, bool inherit);
72
73 public abstract object[] GetCustomAttributes(bool inherit);
74
75 public abstract object[] GetCustomAttributes(Type attributeType, bool inherit);
76
81
82 public override bool Equals(object? obj)
83 {
84 return base.Equals(obj);
85 }
86
87 public override int GetHashCode()
88 {
89 return base.GetHashCode();
90 }
91
92 [MethodImpl(MethodImplOptions.AggressiveInlining)]
93 public static bool operator ==(MemberInfo? left, MemberInfo? right)
94 {
95 if ((object)right == null)
96 {
97 if ((object)left != null)
98 {
99 return false;
100 }
101 return true;
102 }
103 if ((object)left == right)
104 {
105 return true;
106 }
107 return left?.Equals(right) ?? false;
108 }
109
110 public static bool operator !=(MemberInfo? left, MemberInfo? right)
111 {
112 return !(left == right);
113 }
114}
static Exception ByDesign
bool IsDefined(Type attributeType, bool inherit)
virtual bool HasSameMetadataDefinitionAs(MemberInfo other)
Definition MemberInfo.cs:66
override bool Equals(object? obj)
Definition MemberInfo.cs:82
bool HasSameMetadataDefinitionAsCore< TOther >(MemberInfo other)
Definition MemberInfo.cs:45
static bool operator==(MemberInfo? left, MemberInfo? right)
Definition MemberInfo.cs:93
virtual IList< CustomAttributeData > GetCustomAttributesData()
Definition MemberInfo.cs:77
virtual IEnumerable< CustomAttributeData > CustomAttributes
Definition MemberInfo.cs:28
static bool operator!=(MemberInfo? left, MemberInfo? right)
object[] GetCustomAttributes(bool inherit)
virtual bool CacheEquals(object o)
Definition MemberInfo.cs:40
object[] GetCustomAttributes(Type attributeType, bool inherit)
override bool Equals(object? o)
Definition Module.cs:311