Class ConnectorHelpers
- Namespace
- Steeltoe.CloudFoundry.Connector
- Assembly
- Steeltoe.CloudFoundry.ConnectorBase.dll
public static class ConnectorHelpers
- Inheritance
-
ConnectorHelpers
- Inherited Members
Methods
CreateInstance(Type, object[])
Create an instance of a type
public static object CreateInstance(Type t, object[] args = null)
Parameters
Returns
- object
New instance of desired type
FindAssembly(string)
Find an assembly
public static Assembly FindAssembly(string name)
Parameters
name
stringName of the assembly to find
Returns
- Assembly
A representation of the assembly
FindMethod(Type, string, Type[])
Find a method within a type
public static MethodInfo FindMethod(Type type, string methodName, Type[] parameters = null)
Parameters
type
TypeThe type to search
methodName
stringThe name of the method
parameters
Type[](Optional) The parameters in the signature
Returns
- MethodInfo
The method you're searching for
FindType(Assembly, string)
Find a type from within an assembly
public static Type FindType(Assembly assembly, string typeName)
Parameters
Returns
- Type
The type
FindType(string[], string[])
Search a list of assemblies for the first matching type
public static Type FindType(string[] assemblyNames, string[] typeNames)
Parameters
Returns
- Type
An appropriate type
Remarks
Great for finding an implementation type that could have one or more names in one or more assemblies
FindTypeOrThrow(string[], string[], string, string)
Search a list of assemblies for the first matching type
public static Type FindTypeOrThrow(string[] assemblyNames, string[] typeNames, string typeName, string assemblyShortDescription)
Parameters
assemblyNames
string[]List of assembly names to search
typeNames
string[]List of suitable types
typeName
stringTo use in exception
assemblyShortDescription
stringDescribe what might be missing
Returns
- Type
An appropriate type
Remarks
Great for finding an implementation type that could have one or more names in one or more assemblies
Exceptions
- ConnectorException
When type isn't found
Invoke(MethodBase, object, object[])
Invoke a function
public static object Invoke(MethodBase member, object instance, object[] args)
Parameters
member
MethodBaseThe method to execute
instance
objectInstance of an object, if required by the method
args
object[]Arguments to pass to the method
Returns
- object
Results of method call
TrySetProperty(object, string, object)
Try to set a property on an object
public static void TrySetProperty(object obj, string property, object value)