แก้ไข

แชร์ผ่าน


LicenseManager.CreateWithContext Method

Definition

Creates an instance of an object type with a license context.

Overloads

CreateWithContext(Type, LicenseContext)

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

CreateWithContext(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.

CreateWithContext(Type, LicenseContext)

Source:
LicenseManager.cs
Source:
LicenseManager.cs
Source:
LicenseManager.cs

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

public:
 static System::Object ^ CreateWithContext(Type ^ type, System::ComponentModel::LicenseContext ^ creationContext);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static object CreateWithContext (Type type, System.ComponentModel.LicenseContext creationContext);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static object? CreateWithContext (Type type, System.ComponentModel.LicenseContext creationContext);
public static object CreateWithContext (Type type, System.ComponentModel.LicenseContext creationContext);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member CreateWithContext : Type * System.ComponentModel.LicenseContext -> obj
static member CreateWithContext : Type * System.ComponentModel.LicenseContext -> obj
Public Shared Function CreateWithContext (type As Type, creationContext As LicenseContext) As Object

Parameters

type
Type

A Type that represents the type to create.

creationContext
LicenseContext

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

Returns

An instance of the specified type.

Attributes

Remarks

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.

See also

Applies to

CreateWithContext(Type, LicenseContext, Object[])

Source:
LicenseManager.cs
Source:
LicenseManager.cs
Source:
LicenseManager.cs

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

public:
 static System::Object ^ CreateWithContext(Type ^ type, System::ComponentModel::LicenseContext ^ creationContext, cli::array <System::Object ^> ^ args);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static object CreateWithContext (Type type, System.ComponentModel.LicenseContext creationContext, object[] args);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static object? CreateWithContext (Type type, System.ComponentModel.LicenseContext creationContext, object[] args);
public static object CreateWithContext (Type type, System.ComponentModel.LicenseContext creationContext, object[] args);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member CreateWithContext : Type * System.ComponentModel.LicenseContext * obj[] -> obj
static member CreateWithContext : Type * System.ComponentModel.LicenseContext * obj[] -> obj
Public Shared Function CreateWithContext (type As Type, creationContext As LicenseContext, args As Object()) As Object

Parameters

type
Type

A Type that represents the type to create.

creationContext
LicenseContext

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

args
Object[]

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

Returns

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

Attributes

Remarks

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.

See also

Applies to