Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PropertyInfoExtensions.cs
Go to the documentation of this file.
1namespace System.Reflection;
2
3public static class PropertyInfoExtensions
4{
5 public static MethodInfo[] GetAccessors(this PropertyInfo property)
6 {
7 ArgumentNullException.ThrowIfNull(property, "property");
8 return property.GetAccessors();
9 }
10
11 public static MethodInfo[] GetAccessors(this PropertyInfo property, bool nonPublic)
12 {
13 ArgumentNullException.ThrowIfNull(property, "property");
14 return property.GetAccessors(nonPublic);
15 }
16
17 public static MethodInfo? GetGetMethod(this PropertyInfo property)
18 {
19 ArgumentNullException.ThrowIfNull(property, "property");
20 return property.GetGetMethod();
21 }
22
23 public static MethodInfo? GetGetMethod(this PropertyInfo property, bool nonPublic)
24 {
25 ArgumentNullException.ThrowIfNull(property, "property");
26 return property.GetGetMethod(nonPublic);
27 }
28
29 public static MethodInfo? GetSetMethod(this PropertyInfo property)
30 {
31 ArgumentNullException.ThrowIfNull(property, "property");
32 return property.GetSetMethod();
33 }
34
35 public static MethodInfo? GetSetMethod(this PropertyInfo property, bool nonPublic)
36 {
37 ArgumentNullException.ThrowIfNull(property, "property");
38 return property.GetSetMethod(nonPublic);
39 }
40}
static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression("argument")] string? paramName=null)
static ? MethodInfo GetSetMethod(this PropertyInfo property)
static ? MethodInfo GetGetMethod(this PropertyInfo property)
static ? MethodInfo GetGetMethod(this PropertyInfo property, bool nonPublic)
static MethodInfo[] GetAccessors(this PropertyInfo property, bool nonPublic)
static ? MethodInfo GetSetMethod(this PropertyInfo property, bool nonPublic)
static MethodInfo[] GetAccessors(this PropertyInfo property)