CAS.Lib.CodeProtect Namespace
CAS.Lib.CodeProtect.LicenseDsc Namespace
CAS.Lib.CodeProtect.LicenseDsc.Constraints Namespace
CAS.Lib.CodeProtect.Properties Namespace
OOI CodeProtect

CodeProtectLP..::..GetLicense Method (LicenseContext, Type, Object, Boolean)

Gets a license for an instance or type of component, when given a context and whether the denial of a license throws an exception. This is responsible for obtaining the license or reporting the error if non is found.

Namespace:  CAS.Lib.CodeProtect
Assembly:  CAS.CodeProtect (in CAS.CodeProtect.dll)

Syntax


public License GetLicense(
	LicenseContext context,
	Type type,
	Object instance,
	bool allowExceptions
)
Public Function GetLicense ( _
	context As LicenseContext, _
	type As Type, _
	instance As Object, _
	allowExceptions As Boolean _
) As License
public:
License^ GetLicense(
	LicenseContext^ context, 
	Type^ type, 
	Object^ instance, 
	bool^ allowExceptions
)

Parameters

context
Type: LicenseContext
A LicenseContext that specifies where you can use the licensed object.
type
Type: Type
A Type that represents the component requesting the license.
instance
Type: Object
An object that is requesting the license.
allowExceptions
Type: Boolean
true if a LicenseException should be thrown when the component cannot be granted a license; otherwise, false..

Return Value

A valid License.

Exceptions


ExceptionCondition

The reason the validation failed.