NotNull() static private method

static private NotNull ( object obj, string name ) : void
obj object
name string
return void
Esempio n. 1
0
 public static FieldInfo[] GetFields(
     [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields)] this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetFields());
 }
Esempio n. 2
0
 public static MethodInfo?GetGetMethod(this PropertyInfo property)
 {
     Requires.NotNull(property, nameof(property));
     return(property.GetGetMethod());
 }
Esempio n. 3
0
 public static MethodInfo?GetSetMethod(this PropertyInfo property, bool nonPublic)
 {
     Requires.NotNull(property, nameof(property));
     return(property.GetSetMethod(nonPublic));
 }
Esempio n. 4
0
 public static Guid GetModuleVersionId(this Module module)
 {
     Requires.NotNull(module, nameof(module));
     return(module.ModuleVersionId);
 }
Esempio n. 5
0
 public static MethodInfo[] GetAccessors(this PropertyInfo property, bool nonPublic)
 {
     Requires.NotNull(property, nameof(property));
     return(property.GetAccessors(nonPublic));
 }
Esempio n. 6
0
 public static MethodInfo GetBaseDefinition(this MethodInfo method)
 {
     Requires.NotNull(method, nameof(method));
     return(method.GetBaseDefinition());
 }
Esempio n. 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.
 }
Esempio n. 8
0
 public static MethodInfo?GetRaiseMethod(this EventInfo eventInfo)
 {
     Requires.NotNull(eventInfo, nameof(eventInfo));
     return(eventInfo.GetRaiseMethod());
 }
Esempio n. 9
0
 public static MethodInfo?GetRemoveMethod(this EventInfo eventInfo, bool nonPublic)
 {
     Requires.NotNull(eventInfo, nameof(eventInfo));
     return(eventInfo.GetRemoveMethod(nonPublic));
 }
Esempio n. 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));
 }
Esempio n. 11
0
 public static Type[] GetTypes(this Assembly assembly)
 {
     Requires.NotNull(assembly, nameof(assembly));
     return(assembly.GetTypes());
 }
Esempio n. 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));
 }
Esempio n. 13
0
 public static PropertyInfo[] GetProperties(
     [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetProperties());
 }
Esempio n. 14
0
 public static ConstructorInfo[] GetConstructors(
     [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetConstructors());
 }
Esempio n. 15
0
 public static Type[] GetInterfaces(this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetInterfaces());
 }
Esempio n. 16
0
 public static Type[] GetGenericArguments(this Type type)
 {
     Requires.NotNull(type, nameof(type));
     return(type.GetGenericArguments());
 }