System.ComponentModel.LicenseManager.CreateWithContext Method

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

Syntax

public static object CreateWithContext (Type type, LicenseContext creationContext)

Parameters

type
A Type that represents the type to create.
creationContext
A System.ComponentModel.LicenseContext that specifies when you can use the licensed instance.

Returns

An instance of the specified type.

Remarks

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

Requirements

Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0