C# Class System.ComponentModel.LicenseManager

Show file Open project: dotnet/corefx Class Usage Examples

Public Methods

Method Description
CreateWithContext ( Type type, System.ComponentModel.LicenseContext creationContext ) : object

Creates an instance of the specified type, using creationContext as the context in which the licensed instance can be used.

CreateWithContext ( Type type, System.ComponentModel.LicenseContext creationContext, object args ) : object

Creates an instance of the specified type with the specified arguments, using creationContext as the context in which the licensed instance can be used.

IsLicensed ( Type type ) : bool

Determines if the given type has a valid license or not.

IsValid ( Type type ) : bool

Determines if a valid license can be granted for the specified type.

IsValid ( Type type, object instance, System.ComponentModel.License &license ) : bool

Determines if a valid license can be granted for the specified instance of the type. This method creates a valid .

LockContext ( object contextUser ) : void

UnlockContext ( object contextUser ) : void

Validate ( Type type, object instance ) : System.ComponentModel.License

Determines if a license can be granted for the instance of the specified type.

Validate ( Type type ) : void

Determines if a license can be granted for the specified type.

Private Methods

Method Description
CacheProvider ( Type type, LicenseProvider provider ) : void

Caches the provider, both in the instance cache, and the type cache.

GetCachedNoLicenseProvider ( Type type ) : bool

Determines if type was actually cached to have _no_ provider, as opposed to not being cached.

GetCachedProvider ( Type type ) : LicenseProvider

Retrieves a cached instance of the provider associated with the specified type.

GetCachedProviderInstance ( Type providerType ) : LicenseProvider

Retrieves a cached instance of the provider of the specified type.

LicenseManager ( ) : System.Runtime.InteropServices
ValidateInternal ( Type type, object instance, bool allowExceptions, System.ComponentModel.License &license ) : bool

Internal validation helper.

ValidateInternalRecursive ( System.ComponentModel.LicenseContext context, Type type, object instance, bool allowExceptions, System.ComponentModel.License &license, string &licenseKey ) : bool

Since we want to walk up the entire inheritance change, when not give an instance, we need another helper method to walk up the chain...

Method Details

CreateWithContext() public static method

Creates an instance of the specified type, using creationContext as the context in which the licensed instance can be used.

public static CreateWithContext ( Type type, System.ComponentModel.LicenseContext creationContext ) : object
type Type
creationContext System.ComponentModel.LicenseContext
return object

CreateWithContext() public static method

Creates an instance of the specified type with the specified arguments, using creationContext as the context in which the licensed instance can be used.

public static CreateWithContext ( Type type, System.ComponentModel.LicenseContext creationContext, object args ) : object
type Type
creationContext System.ComponentModel.LicenseContext
args object
return object

IsLicensed() public static method

Determines if the given type has a valid license or not.

public static IsLicensed ( Type type ) : bool
type Type
return bool

IsValid() public static method

Determines if a valid license can be granted for the specified type.

public static IsValid ( Type type ) : bool
type Type
return bool

IsValid() public static method

Determines if a valid license can be granted for the specified instance of the type. This method creates a valid .

public static IsValid ( Type type, object instance, System.ComponentModel.License &license ) : bool
type Type
instance object
license System.ComponentModel.License
return bool

LockContext() public static method

public static LockContext ( object contextUser ) : void
contextUser object
return void

UnlockContext() public static method

public static UnlockContext ( object contextUser ) : void
contextUser object
return void

Validate() public static method

Determines if a license can be granted for the instance of the specified type.

public static Validate ( Type type, object instance ) : System.ComponentModel.License
type Type
instance object
return System.ComponentModel.License

Validate() public static method

Determines if a license can be granted for the specified type.

public static Validate ( Type type ) : void
type Type
return void