LicenseManager.CreateWithContext Method (Type, LicenseContext, Object[])


Creates an instance of the specified type with the specified arguments, given a context in which you can use the licensed instance.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public static object CreateWithContext(
	Type type,
	LicenseContext creationContext,
	object[] args


Type: System.Type

A Type that represents the type to create.

Type: System.ComponentModel.LicenseContext

A LicenseContext that specifies when you can use the licensed instance.

Type: System.Object[]

An array of type Object that represents the arguments for the type.

Return Value

Type: System.Object

An instance of the specified type with the given array of arguments.

The LicenseContext you specify as the creationContext parameter is used as the CurrentContext for the life of this License. This method blocks all other threads in the AppDomain from modifying the CurrentContext, allowing CreateWithContext to behave as an atomic operation.

.NET Framework
Available since 1.1
Return to top