Class TypeHelper
- Namespace
- Dynamicweb.Extensibility
- Assembly
- Dynamicweb.Core.dll
- Inheritance
-
Type
Helper
- Inherited Members
Methods
GetCustomAttribute<T>(MemberInfo)
Parameters
member
MemberInfo
Returns
- T
Type Parameters
T
GetCustomAttribute<T>(MemberInfo, bool)
Parameters
member
MemberInfo inherit
bool
Returns
- T
Type Parameters
T
GetCustomAttributes<T>(MemberInfo)
Parameters
member
MemberInfo
Returns
- IEnumerable<T>
Type Parameters
T
GetCustomAttributes<T>(MemberInfo, bool)
public static IEnumerable<T> GetCustomAttributes<T>(MemberInfo member, bool inherit) where T : Attribute
Parameters
member
MemberInfo inherit
bool
Returns
- IEnumerable<T>
Type Parameters
T
GetGenericTypeArguments(Type, Type)
Parameters
Returns
- Type[]
GetProperty(Type, string)
Parameters
Returns
GetPropertyFromExpression(Expression)
Parameters
expression
Expression
Returns
GetPropertyValue(object, string)
Parameters
Returns
GetTypeNameWithAssembly(Type)
Get name of the type in format "[FullName], [AssemblyName]"
Parameters
type
Type
Returns
GetTypeNameWithoutAssembly(string)
Parameters
typeName
string
Returns
HasCustomAttribute<T>(MemberInfo)
Parameters
member
MemberInfo
Returns
Type Parameters
T
InvokeMethod(object, string, object?[]?)
Invokes the method of the specfied name on the specified instance with the specified parameters.
Parameters
instance
objectThe instance.
methodName
stringName of the method.
arguments
object[]The arguments.
Returns
InvokeStaticGenericMethod<T>(Type, Type, string, params object?[])
Invokes a static method on the given generic type.
public static T? InvokeStaticGenericMethod<T>(Type type, Type genericType, string methodName, params object?[] arguments)
Parameters
type
TypeThe type.
genericType
TypeThe generic type.
methodName
stringName of method.
arguments
object[]The arguments.
Returns
- T
Type Parameters
T
Type of returned result.
InvokeStaticMethod(Type, string, object?[]?)
Invokes a static method on the given type. The method must be static and public. The params array must contain elements that exactly match a signature for given method.
Parameters
Returns
IsDerivedFrom(Type, Type, params Type[])
Parameters
Returns
IsDerivedFrom<TBase>(Type, params Type[])
Parameters
Returns
Type Parameters
TBase
IsTypeNameWithAssembly(string)
Parameters
typeName
string
Returns
SetPropertyValue(object, string, object?)
Parameters
TryGetProperty(Type, string, out PropertyInfo?)
Parameters
type
TypepropertyName
stringproperty
PropertyInfo
Returns
TryGetPropertyValue(object?, string?, out object?)
Parameters
Returns
TryInvokeMethod(object, string, object?[]?, out object?)
public static bool TryInvokeMethod(object instance, string methodName, object?[]? arguments, out object? value)
Parameters
Returns
TryInvokeStaticMethod(Type, string, object?[]?, out object?)
public static bool TryInvokeStaticMethod(Type type, string methodName, object?[]? arguments, out object? value)