DeployLX Software Protection System

ScriptLimit..::..ValidateScript Property

Gets or sets the script to run when Validate(SecureLicenseContext) is called.

Syntax

Public Property ValidateScript As String
	Get
	Set
public string ValidateScript { get; set; }

Remarks

The script must return one of the ValidationResult values. The script has access to the following Global objects.

VariableDescription
ContextReference to the SecureLicenseContext of the current validation request.
LimitReference to the ScriptLimit.
LicenseReference to the SecureLicense being validated.

Instead of providing actual script, you may also provide the name of a static method to be invoked in another assembly. To do that use the following syntax:

invoke::FullyQualifiedTypeName.MethodName,AssemblyName

The signature of the method must be

Visual Basic
Public Shared Function Validate(ByVal context As SecureLicenseContext, ByVal limit As ScriptLimit, ByVal license As SecureLicense) As ValidationResult
C#
public static ValidationResult Validate( SecureLicenseContext context, ScriptLimit limit, SecureLicense license )

Examples

This sample demonstrates a basic script to be used by the ValidateScript or GrantedScript.
Visual Basic
If Environment.MachineName <> Limit.Properties("MachineName") Then
    Return Context.ReportError("Invalid machine.", Limit)
End If

Return ValidationResult.Valid
C#
if( Environment.MachineName != Limit.Properties[ "MachineName" ] )
    return Context.ReportError( "Invalid machine.", Limit );

return ValidationResult.Valid;

Assembly:  DeployLX.Licensing.v5 (in DeployLX.Licensing.v5.dll)

See Also