DeployLX Software Protection System

DelayedLimit Class

Defines the base class for Limits that can perform their validation asynchronously. This is useful for validation that takes a long time to perform and is most likely to be true.

Syntax

<SerializableAttribute> _
Public MustInherit Class DelayedLimit _
	Inherits Limit
[SerializableAttribute]
public abstract class DelayedLimit : Limit

Remarks

Delayed limits validate in a asynchronous thread to allow other validation to complete quickly. Delayed limits are expected to be true in most scenarios so delaying the validation improves performance greatly. To receive delayed validation failure notices, subscribe to the DelayedValidationFailed event.

Examples

This code demonstrates how to Validate a license that contains a DelayedLimit.
Visual Basic
Imports DeployLX.Licensing.v5

...

Public Sub DelayedLimitEvents()
    AddHandler SecureLicenseManager.DelayedValidationComplete, AddressOf SecureLicenseManager_DelayedValidationComplete
    AddHandler SecureLicenseManager.DelayedValidationFailed, AddressOf SecureLicenseManager_DelayedValidationFailed

    SecureLicenseManager.Validate(Me, Nothing, Nothing)
End Sub

Private Sub SecureLicenseManager_DelayedValidationFailed(ByVal sender As Object, ByVal e As LicenseEventArgs)
    MessageBox.Show("There are too many users attempting to use the same serial number.")
    Application.Exit()
End Sub

Private Sub SecureLicenseManager_DelayedValidationComplete(ByVal sender As Object, ByVal e As LicenseEventArgs)
    ' Enable features that may have required remote validation
End Sub
C#
using DeployLX.Licensing.v5;

...

public void DelayedLimitEvents()
{
    SecureLicenseManager.DelayedValidationComplete += new LicenseEventHandler( SecureLicenseManager_DelayedValidationComplete );
    SecureLicenseManager.DelayedValidationFailed += new LicenseEventHandler( SecureLicenseManager_DelayedValidationFailed );

    SecureLicenseManager.Validate( this, null, null );
}

void SecureLicenseManager_DelayedValidationFailed( object sender, LicenseEventArgs e )
{
    MessageBox.Show( "There are too many users attempting to use the same serial number." );
    Application.Exit();
}

void SecureLicenseManager_DelayedValidationComplete( object sender, LicenseEventArgs e )
{
    // Enable features that may have required remote validation
}

Inheritance Hierarchy

System..::..Object
  DeployLX.Licensing.v5..::..Limit
    DeployLX.Licensing.v5..::..DelayedLimit
      DeployLX.Licensing.Nlm.v5..::..NetworkLicenseClientLimit
      DeployLX.Licensing.v5..::..LicenseServerLimit

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

See Also