Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MethodInfo.cs
Go to the documentation of this file.
3
4namespace System.Reflection;
5
6public abstract class MethodInfo : MethodBase
7{
8 public override MemberTypes MemberType => MemberTypes.Method;
9
11 {
12 get
13 {
15 }
16 }
17
18 public virtual Type ReturnType
19 {
20 get
21 {
23 }
24 }
25
27
28 internal virtual int GenericParameterCount => GetGenericArguments().Length;
29
34
39
40 [RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
41 public virtual MethodInfo MakeGenericMethod(params Type[] typeArguments)
42 {
44 }
45
46 public abstract MethodInfo GetBaseDefinition();
47
48 public virtual Delegate CreateDelegate(Type delegateType)
49 {
51 }
52
53 public virtual Delegate CreateDelegate(Type delegateType, object? target)
54 {
56 }
57
58 public T CreateDelegate<T>() where T : Delegate
59 {
60 return (T)CreateDelegate(typeof(T));
61 }
62
63 public T CreateDelegate<T>(object? target) where T : Delegate
64 {
65 return (T)CreateDelegate(typeof(T), target);
66 }
67
68 public override bool Equals(object? obj)
69 {
70 return base.Equals(obj);
71 }
72
73 public override int GetHashCode()
74 {
75 return base.GetHashCode();
76 }
77
78 [MethodImpl(MethodImplOptions.AggressiveInlining)]
79 public static bool operator ==(MethodInfo? left, MethodInfo? right)
80 {
81 if ((object)right == null)
82 {
83 if ((object)left != null)
84 {
85 return false;
86 }
87 return true;
88 }
89 if ((object)left == right)
90 {
91 return true;
92 }
93 return left?.Equals(right) ?? false;
94 }
95
96 public static bool operator !=(MethodInfo? left, MethodInfo? right)
97 {
98 return !(left == right);
99 }
100}
static Exception ByDesign
virtual Delegate CreateDelegate(Type delegateType)
Definition MethodInfo.cs:48
override MemberTypes MemberType
Definition MethodInfo.cs:8
virtual MethodInfo GetGenericMethodDefinition()
Definition MethodInfo.cs:35
virtual ParameterInfo ReturnParameter
Definition MethodInfo.cs:11
virtual Delegate CreateDelegate(Type delegateType, object? target)
Definition MethodInfo.cs:53
override bool Equals(object? obj)
Definition MethodInfo.cs:68
static bool operator==(MethodInfo? left, MethodInfo? right)
Definition MethodInfo.cs:79
ICustomAttributeProvider ReturnTypeCustomAttributes
Definition MethodInfo.cs:26
virtual MethodInfo MakeGenericMethod(params Type[] typeArguments)
Definition MethodInfo.cs:41
override Type[] GetGenericArguments()
Definition MethodInfo.cs:30
virtual int GenericParameterCount
Definition MethodInfo.cs:28
static bool operator!=(MethodInfo? left, MethodInfo? right)
Definition MethodInfo.cs:96
static string NotSupported_SubclassOverride
Definition SR.cs:1714
Definition SR.cs:7