Click or drag to resize

ReflectionServiceGetClassInstanceByAttribute Method

Tries to get a class instance for a given attribute type. All loaded assemblies are searched for classes that attributeType applies to, then for all found classes the instantiation of a class is tried, until a instance is created successfully.

Namespace: Altaxo.Main.Services
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static Object? GetClassInstanceByAttribute(
	Type attributeType,
	Type expectedType,
	Object[] creationArgs
)

Parameters

attributeType  Type
The type of attribute the class(es) to instantiate must be assigned to.
expectedType  Type
The expected type of return value.
creationArgs  Object
The creation arguments used to instantiate a class.

Return Value

Object
The instance of the first class for which the instantiation was successfull and results in the expectedType. Otherwise null.
See Also