Example #1
0
 public static FieldInfo[] GetFields(
     [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetFields());
 }
Example #2
0
 public static MethodInfo?GetGetMethod(this PropertyInfo property)
 {
     Requires.NotNull(property, nameof(property));
     return(property.GetGetMethod());
 }
Example #3
0
 public static MethodInfo?GetSetMethod(this PropertyInfo property, bool nonPublic)
 {
     Requires.NotNull(property, nameof(property));
     return(property.GetSetMethod(nonPublic));
 }
Example #4
0
 public static Guid GetModuleVersionId(this Module module)
 {
     Requires.NotNull(module, nameof(module));
     return(module.ModuleVersionId);
 }
Example #5
0
 public static MethodInfo[] GetAccessors(this PropertyInfo property, bool nonPublic)
 {
     Requires.NotNull(property, nameof(property));
     return(property.GetAccessors(nonPublic));
 }
Example #6
0
 public static MethodInfo GetBaseDefinition(this MethodInfo method)
 {
     Requires.NotNull(method, nameof(method));
     return(method.GetBaseDefinition());
 }
Example #7
0
 public static bool HasModuleVersionId(this Module module)
 {
     Requires.NotNull(module, nameof(module));
     return(true); // not expected to fail on platforms with Module.ModuleVersionId built-in.
 }
Example #8
0
 public static MethodInfo?GetRaiseMethod(this EventInfo eventInfo)
 {
     Requires.NotNull(eventInfo, nameof(eventInfo));
     return(eventInfo.GetRaiseMethod());
 }
Example #9
0
 public static MethodInfo?GetRemoveMethod(this EventInfo eventInfo, bool nonPublic)
 {
     Requires.NotNull(eventInfo, nameof(eventInfo));
     return(eventInfo.GetRemoveMethod(nonPublic));
 }
Example #10
0
 public static bool IsInstanceOfType(this Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] object?o)
 {
     Requires.NotNull(type, nameof(type));
     return(type.IsInstanceOfType(o));
 }
Example #11
0
 public static Type[] GetTypes(this Assembly assembly)
 {
     Requires.NotNull(assembly, nameof(assembly));
     return(assembly.GetTypes());
 }
Example #12
0
 public static bool IsAssignableFrom(this Type type, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] Type?c)
 {
     Requires.NotNull(type, nameof(type));
     return(type.IsAssignableFrom(c));
 }
Example #13
0
 public static PropertyInfo[] GetProperties(
     [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetProperties());
 }
Example #14
0
 public static ConstructorInfo[] GetConstructors(
     [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetConstructors());
 }
Example #15
0
 public static Type[] GetInterfaces(this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetInterfaces());
 }
Example #16
0
 public static Type[] GetGenericArguments(this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetGenericArguments());
 }