Class MemberUtility
Inheritance
object
MemberUtility
Assembly: solution.dll
Syntax
public static class MemberUtility
Methods
AllowsNull(ParameterInfo)
Declaration
public static bool AllowsNull(this ParameterInfo parameterInfo)
Parameters
| Type |
Name |
Description |
| ParameterInfo |
parameterInfo |
|
Returns
CanWrite(FieldInfo)
Declaration
public static bool CanWrite(this FieldInfo fieldInfo)
Parameters
| Type |
Name |
Description |
| FieldInfo |
fieldInfo |
|
Returns
CreateDelegate(MethodInfo, Type)
Declaration
public static Delegate CreateDelegate(this MethodInfo methodInfo, Type delegateType)
Parameters
| Type |
Name |
Description |
| MethodInfo |
methodInfo |
|
| Type |
delegateType |
|
Returns
| Type |
Description |
| Delegate |
|
DefaultValue(ParameterInfo)
Declaration
public static object DefaultValue(this ParameterInfo parameterInfo)
Parameters
| Type |
Name |
Description |
| ParameterInfo |
parameterInfo |
|
Returns
Disambiguate(IEnumerable<ConstructorInfo>, Type, IEnumerable<Type>)
Declaration
public static ConstructorInfo Disambiguate(this IEnumerable<ConstructorInfo> constructors, Type type, IEnumerable<Type> parameterTypes)
Parameters
| Type |
Name |
Description |
| IEnumerable<ConstructorInfo> |
constructors |
|
| Type |
type |
|
| IEnumerable<Type> |
parameterTypes |
|
Returns
| Type |
Description |
| ConstructorInfo |
|
Disambiguate(IEnumerable<FieldInfo>, Type)
Declaration
public static FieldInfo Disambiguate(this IEnumerable<FieldInfo> fields, Type type)
Parameters
| Type |
Name |
Description |
| IEnumerable<FieldInfo> |
fields |
|
| Type |
type |
|
Returns
| Type |
Description |
| FieldInfo |
|
Disambiguate(IEnumerable<MethodInfo>, Type, IEnumerable<Type>)
Declaration
public static MethodInfo Disambiguate(this IEnumerable<MethodInfo> methods, Type type, IEnumerable<Type> parameterTypes)
Parameters
| Type |
Name |
Description |
| IEnumerable<MethodInfo> |
methods |
|
| Type |
type |
|
| IEnumerable<Type> |
parameterTypes |
|
Returns
| Type |
Description |
| MethodInfo |
|
Disambiguate(IEnumerable<MethodInfo>, Type, IEnumerable<Type>, IEnumerable<Type>)
Declaration
public static MethodInfo Disambiguate(this IEnumerable<MethodInfo> methods, Type type, IEnumerable<Type> parameterTypes, IEnumerable<Type> genericArgumentTypes)
Parameters
| Type |
Name |
Description |
| IEnumerable<MethodInfo> |
methods |
|
| Type |
type |
|
| IEnumerable<Type> |
parameterTypes |
|
| IEnumerable<Type> |
genericArgumentTypes |
|
Returns
| Type |
Description |
| MethodInfo |
|
Disambiguate(IEnumerable<PropertyInfo>, Type)
Declaration
public static PropertyInfo Disambiguate(this IEnumerable<PropertyInfo> properties, Type type)
Parameters
| Type |
Name |
Description |
| IEnumerable<PropertyInfo> |
properties |
|
| Type |
type |
|
Returns
| Type |
Description |
| PropertyInfo |
|
ExtendedDeclaringType(MemberInfo, bool)
Declaration
public static Type ExtendedDeclaringType(this MemberInfo memberInfo, bool invokeAsExtension)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
| bool |
invokeAsExtension |
|
Returns
GetAccessorType(MemberInfo)
Declaration
public static Type GetAccessorType(this MemberInfo memberInfo)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
Returns
GetConstructorAccepting(Type, params Type[])
Declaration
public static ConstructorInfo GetConstructorAccepting(this Type type, params Type[] paramTypes)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| Type[] |
paramTypes |
|
Returns
| Type |
Description |
| ConstructorInfo |
|
GetConstructorAccepting(Type, Type[], bool)
Declaration
public static ConstructorInfo GetConstructorAccepting(this Type type, Type[] paramTypes, bool nonPublic)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| Type[] |
paramTypes |
|
| bool |
nonPublic |
|
Returns
| Type |
Description |
| ConstructorInfo |
|
GetDefaultConstructor(Type)
Declaration
public static ConstructorInfo GetDefaultConstructor(this Type type)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
Returns
| Type |
Description |
| ConstructorInfo |
|
GetExtendedMember(Type, string, MemberTypes, BindingFlags)
Declaration
public static MemberInfo[] GetExtendedMember(this Type type, string name, MemberTypes types, BindingFlags flags)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| string |
name |
|
| MemberTypes |
types |
|
| BindingFlags |
flags |
|
Returns
| Type |
Description |
| MemberInfo[] |
|
GetExtendedMembers(Type, BindingFlags)
Declaration
public static MemberInfo[] GetExtendedMembers(this Type type, BindingFlags flags)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| BindingFlags |
flags |
|
Returns
| Type |
Description |
| MemberInfo[] |
|
GetExtensionMethods(Type, bool)
Declaration
public static IEnumerable<MethodInfo> GetExtensionMethods(this Type thisArgumentType, bool inherited = true)
Parameters
| Type |
Name |
Description |
| Type |
thisArgumentType |
|
| bool |
inherited |
|
Returns
| Type |
Description |
| IEnumerable<MethodInfo> |
|
GetFieldUnambiguous(Type, string, BindingFlags)
Declaration
public static FieldInfo GetFieldUnambiguous(this Type type, string name, BindingFlags flags)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| string |
name |
|
| BindingFlags |
flags |
|
Returns
| Type |
Description |
| FieldInfo |
|
GetInvocationParameters(MethodBase, bool)
Declaration
public static IEnumerable<ParameterInfo> GetInvocationParameters(this MethodBase methodBase, bool invokeAsExtension)
Parameters
| Type |
Name |
Description |
| MethodBase |
methodBase |
|
| bool |
invokeAsExtension |
|
Returns
| Type |
Description |
| IEnumerable<ParameterInfo> |
|
GetInvocationParameters(MethodBase, Type)
Declaration
public static IEnumerable<ParameterInfo> GetInvocationParameters(this MethodBase methodBase, Type targetType)
Parameters
| Type |
Name |
Description |
| MethodBase |
methodBase |
|
| Type |
targetType |
|
Returns
| Type |
Description |
| IEnumerable<ParameterInfo> |
|
GetMethodUnambiguous(Type, string, BindingFlags)
Declaration
public static MethodInfo GetMethodUnambiguous(this Type type, string name, BindingFlags flags)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| string |
name |
|
| BindingFlags |
flags |
|
Returns
| Type |
Description |
| MethodInfo |
|
GetPropertyUnambiguous(Type, string, BindingFlags)
Declaration
public static PropertyInfo GetPropertyUnambiguous(this Type type, string name, BindingFlags flags)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| string |
name |
|
| BindingFlags |
flags |
|
Returns
| Type |
Description |
| PropertyInfo |
|
GetPublicConstructorAccepting(Type, params Type[])
Declaration
public static ConstructorInfo GetPublicConstructorAccepting(this Type type, params Type[] paramTypes)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
| Type[] |
paramTypes |
|
Returns
| Type |
Description |
| ConstructorInfo |
|
GetPublicDefaultConstructor(Type)
Declaration
public static ConstructorInfo GetPublicDefaultConstructor(this Type type)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
Returns
| Type |
Description |
| ConstructorInfo |
|
HasDefaultValue(ParameterInfo)
Declaration
public static bool HasDefaultValue(this ParameterInfo parameterInfo)
Parameters
| Type |
Name |
Description |
| ParameterInfo |
parameterInfo |
|
Returns
HasOutModifier(ParameterInfo)
Declaration
public static bool HasOutModifier(this ParameterInfo parameterInfo)
Parameters
| Type |
Name |
Description |
| ParameterInfo |
parameterInfo |
|
Returns
IsAccessor(MemberInfo)
Declaration
public static bool IsAccessor(this MemberInfo memberInfo)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
Returns
IsExtension(MethodInfo)
Declaration
public static bool IsExtension(this MethodInfo methodInfo)
Parameters
| Type |
Name |
Description |
| MethodInfo |
methodInfo |
|
Returns
IsExtensionMethod(MemberInfo)
Declaration
public static bool IsExtensionMethod(this MemberInfo memberInfo)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
Returns
IsGenericExtension(MethodInfo)
Declaration
public static bool IsGenericExtension(this MethodInfo methodInfo)
Parameters
| Type |
Name |
Description |
| MethodInfo |
methodInfo |
|
Returns
IsInvokedAsExtension(MethodBase, Type)
Declaration
public static bool IsInvokedAsExtension(this MethodBase methodBase, Type targetType)
Parameters
| Type |
Name |
Description |
| MethodBase |
methodBase |
|
| Type |
targetType |
|
Returns
IsOperator(MethodInfo)
Declaration
public static bool IsOperator(this MethodInfo method)
Parameters
| Type |
Name |
Description |
| MethodInfo |
method |
|
Returns
IsPubliclyGettable(MemberInfo)
Declaration
public static bool IsPubliclyGettable(this MemberInfo memberInfo)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
Returns
IsStatic(MemberInfo)
Declaration
public static bool IsStatic(this MemberInfo memberInfo)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
Returns
IsStatic(PropertyInfo)
Declaration
public static bool IsStatic(this PropertyInfo propertyInfo)
Parameters
| Type |
Name |
Description |
| PropertyInfo |
propertyInfo |
|
Returns
IsUserDefinedConversion(MethodInfo)
Declaration
public static bool IsUserDefinedConversion(this MethodInfo method)
Parameters
| Type |
Name |
Description |
| MethodInfo |
method |
|
Returns
MakeGenericMethodVia(MethodInfo, params Type[])
Declaration
public static MethodInfo MakeGenericMethodVia(this MethodInfo openConstructedMethod, params Type[] closedConstructedParameterTypes)
Parameters
| Type |
Name |
Description |
| MethodInfo |
openConstructedMethod |
|
| Type[] |
closedConstructedParameterTypes |
|
Returns
| Type |
Description |
| MethodInfo |
|
PseudoDefaultValue(ParameterInfo)
Declaration
public static object PseudoDefaultValue(this ParameterInfo parameterInfo)
Parameters
| Type |
Name |
Description |
| ParameterInfo |
parameterInfo |
|
Returns
SignatureMatches(ConstructorInfo, string, IEnumerable<Type>)
Declaration
public static bool SignatureMatches(this ConstructorInfo constructor, string name, IEnumerable<Type> parameterTypes)
Parameters
| Type |
Name |
Description |
| ConstructorInfo |
constructor |
|
| string |
name |
|
| IEnumerable<Type> |
parameterTypes |
|
Returns
SignatureMatches(FieldInfo, string)
Declaration
public static bool SignatureMatches(this FieldInfo field, string name)
Parameters
| Type |
Name |
Description |
| FieldInfo |
field |
|
| string |
name |
|
Returns
SignatureMatches(MethodInfo, string, IEnumerable<Type>, IEnumerable<Type>, bool)
Declaration
public static bool SignatureMatches(this MethodInfo method, string name, IEnumerable<Type> parameterTypes, IEnumerable<Type> genericArgumentTypes, bool invokeAsExtension)
Parameters
| Type |
Name |
Description |
| MethodInfo |
method |
|
| string |
name |
|
| IEnumerable<Type> |
parameterTypes |
|
| IEnumerable<Type> |
genericArgumentTypes |
|
| bool |
invokeAsExtension |
|
Returns
SignatureMatches(MethodInfo, string, IEnumerable<Type>, bool)
Declaration
public static bool SignatureMatches(this MethodInfo method, string name, IEnumerable<Type> parameterTypes, bool invokeAsExtension)
Parameters
| Type |
Name |
Description |
| MethodInfo |
method |
|
| string |
name |
|
| IEnumerable<Type> |
parameterTypes |
|
| bool |
invokeAsExtension |
|
Returns
SignatureMatches(PropertyInfo, string)
Declaration
public static bool SignatureMatches(this PropertyInfo property, string name)
Parameters
| Type |
Name |
Description |
| PropertyInfo |
property |
|
| string |
name |
|
Returns
ToManipulator(ConstructorInfo, Type)
Declaration
public static Member ToManipulator(this ConstructorInfo constructorInfo, Type targetType)
Parameters
| Type |
Name |
Description |
| ConstructorInfo |
constructorInfo |
|
| Type |
targetType |
|
Returns
ToManipulator(FieldInfo, Type)
Declaration
public static Member ToManipulator(this FieldInfo fieldInfo, Type targetType)
Parameters
| Type |
Name |
Description |
| FieldInfo |
fieldInfo |
|
| Type |
targetType |
|
Returns
ToManipulator(MemberInfo)
Declaration
public static Member ToManipulator(this MemberInfo memberInfo)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
Returns
ToManipulator(MemberInfo, Type)
Declaration
public static Member ToManipulator(this MemberInfo memberInfo, Type targetType)
Parameters
| Type |
Name |
Description |
| MemberInfo |
memberInfo |
|
| Type |
targetType |
|
Returns
ToManipulator(MethodInfo, Type)
Declaration
public static Member ToManipulator(this MethodInfo methodInfo, Type targetType)
Parameters
| Type |
Name |
Description |
| MethodInfo |
methodInfo |
|
| Type |
targetType |
|
Returns
ToManipulator(PropertyInfo, Type)
Declaration
public static Member ToManipulator(this PropertyInfo propertyInfo, Type targetType)
Parameters
| Type |
Name |
Description |
| PropertyInfo |
propertyInfo |
|
| Type |
targetType |
|
Returns
UnderlyingParameterType(ParameterInfo)
Declaration
public static Type UnderlyingParameterType(this ParameterInfo parameterInfo)
Parameters
| Type |
Name |
Description |
| ParameterInfo |
parameterInfo |
|
Returns