AgileDotNetLicenseProvider.Validate(LicenseContext, Type, Object, Boolean) Method

SecureTeam Copy Protection

AgileDotNetLicenseProvider.Validate

Gets a license for an instance or type of component. The license found is validated against its Locks

Syntax

Public Overloads Shared Sub Validate( _
   ByVal context As LicenseContext, _
   ByVal type As Type, _
   ByVal instance As Object, _
   ByVal allowExceptions As Boolean _
)
public static AgileDotNetLicense Validate(
   LicenseContext context,
   Type type,
   object instance,
   bool allowExceptions
);

Parameters

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

Return Value

A valid AgileDotNetLicense.

Remarks

The method looks for all license files ending with 'lic' extension located at the application's folder. It then validates each license with its Locks, the first valid license is then returned to the caller. A LicenseNotFoundException is thrown when the component cannot be granted a license, alternatively if allowExceptions is set to false a null value is returned. To add additional license search folders use AddSearchDirectory.

Exceptions

Exception TypeCondition
LicenseNotFoundExceptionThrown when the system cannot find a valid license.

See Also

AgileDotNetLicenseProvider Class | AgileDotNet.Licensing Namespace | AgileDotNetLicenseProvider.Validate Overload List