Class TypeExtensions
Static class containing extension methods for Type objects.
Namespace: Tableau.Migration
Assembly: Tableau.Migration.dll
Syntax
public static class TypeExtensions
Methods
GetAllInterfaceMethods(Type)
Gets all the methods of an interface. GetMethods() will get all the methods of a class, base and inherited. However, for interfaces it only gets the extended methods. This method will recusively find all the methods of the inherited interfaces and aggregate them. Calling this overload is equivalent to calling the GetAllInterfaceMethods(BindingFlags) overload with a bindingAttr argument equal to BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public
Declaration
public static MethodInfo[] GetAllInterfaceMethods(this Type interfaceType)
Parameters
Type | Name | Description |
---|---|---|
Type | interfaceType | The interface type. Ex: typeof(IMyInterface) |
Returns
Type | Description |
---|---|
MethodInfo[] |
GetAllInterfaceMethods(Type, BindingFlags)
Gets all the methods of an interface. GetMethods() will get all the methods of a class, base and inherited. However, for interfaces it only gets the extended methods. This method will recusively find all the methods of the inherited interfaces and aggregate them.
Declaration
public static MethodInfo[] GetAllInterfaceMethods(this Type interfaceType, BindingFlags bindingAttr = BindingFlags.Default)
Parameters
Type | Name | Description |
---|---|---|
Type | interfaceType | The interface type. Ex: typeof(IMyInterface) |
BindingFlags | bindingAttr | BindingFlags to use. |
Returns
Type | Description |
---|---|
MethodInfo[] |
GetAllInterfaceProperties(Type)
Gets all the properites of an interface. GetProperties() will get all the properties of a class, base and inherited. However, for interfaces it only gets the extended properties. This method will recusively find all the properties of the inherited interfaces and aggregate them. Calling this overload is equivalent to calling the GetAllInterfaceProperties(BindingFlags) overload with a bindingAttr argument equal to BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public
Declaration
public static PropertyInfo[] GetAllInterfaceProperties(this Type interfaceType)
Parameters
Type | Name | Description |
---|---|---|
Type | interfaceType | The interface type. Ex: typeof(IMyInterface) |
Returns
Type | Description |
---|---|
PropertyInfo[] |
GetAllInterfaceProperties(Type, BindingFlags)
Gets all the properites of an interface. GetProperties() will get all the properties of a class, base and inherited. However, for interfaces it only gets the extended properties. This method will recusively find all the properties of the inherited interfaces and aggregate them.
Declaration
public static PropertyInfo[] GetAllInterfaceProperties(this Type interfaceType, BindingFlags bindingAttr = BindingFlags.Default)
Parameters
Type | Name | Description |
---|---|---|
Type | interfaceType | The interface type. Ex: typeof(IMyInterface) |
BindingFlags | bindingAttr | BindingFlags to use. |
Returns
Type | Description |
---|---|
PropertyInfo[] |
GetFormattedName(Type)
Gets the formatted name of the specified Type.
Declaration
public static string GetFormattedName(this Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The Type to get the formatted name for. |
Returns
Type | Description |
---|---|
string | The formatted name of the Type. |