DomainRestriction

Namespace: Babel.Licensing Assembly: Babel.Licensing.dll

Defines a used to tie the license to a given network domain.

public class DomainRestriction : Restriction, IObservableObject

Inheritance

objectRestrictionDomainRestriction

Implements

IObservableObject

Inherited Members

Restriction.Validate(ILicenseContext, Type, object), Restriction.Attach(IObjectListener), Restriction.Detach(IObjectListener), Restriction.Notify(params object[]), Restriction.Name, Restriction.License, Restriction.Listeners, Restriction.Id, Restriction.ExpireDate, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

// Creates string license restricted to a given network domain 
var license = new StringLicense();

// Add a beta information
DomainRestriction domain = new DomainRestriction();
domain.Domain = "ACMENET";

license.Restrictions.Add(domain);

// Generate the license key
var signer = RSASignature.CreateFromKeyFile("Keys.snk");
string licenseKey = license.SignWith(signer).ToReadableString();

Constructors

DomainRestriction()

Initializes a new instance of the class.

public DomainRestriction()

Properties

Domain

Gets the network domain name.

public string Domain { get; set; }

Property Value

string

Name

Gets the restriction name.

public override string Name { get; }

Property Value

string

Role

Gets the role associated to this domain.

public string Role { get; set; }

Property Value

string

Methods

Validate(ILicenseContext, Type, object)

Validates the current domain license restriction.

public override ValidationResult Validate(ILicenseContext context, Type type, object instance)

Parameters

NameDescription

The license context.

The for which the restriction is validated.

The object instance for which the restriction is validated.

Returns

NameDescription

The validation result code .

Last updated