LicenseManager.CreateWithContext Method (Type, LicenseContext)


Creates an instance of the specified type, 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


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.

Return Value

Type: System.Object

An instance of the specified type.

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


for access to private class members and metadata. Associated enumeration: Unrestricted

.NET Framework
Available since 1.1
Return to top