InvokeConstructor

.NET Vuser Functions

Invokes a constructor.

object InvokeConstructor(Type type, int metadataToken, object[] parameters);
typeThe type of object to create.
metadataToken The metadataToken of the constructor.
parameters The constructor parameters.

InvokeConstructor invokes the constructors indicated by the type and parameters. It returns the constructor instance.

Note: Do not add this function manually to a script. It is generated by VuGen automatically.

Parameterization

Parameterization is not applicable to this function.

Example

This example invokes a constructor with parameters that were retrieved through a GetType method.

public static object NestedInternalClass() {

object[] parameters = new object[0];

object result = LrReplayUtils.InvokeConstructor( System.Type.GetType ("AccessModifiers.InternalClass, AccessModifiers, Version=1.0.0.0, Culture=neutral,"

+" PublicKeyToken=null"), 100663403, parameters);

return result;

}