Click or drag to resize
DomainRestriction Class
Defines a Restriction used to tie the license to a given network domain.
Inheritance Hierarchy

Namespace:  Babel.Licensing
Assemblies:   Babel.Licensing (in Babel.Licensing.dll) Version: 2.4.0.0
  Babel.Licensing (in Babel.Licensing.dll) Version: 2.4.0.0
Syntax
public class DomainRestriction : Restriction

The DomainRestriction type exposes the following members.

Constructors
  NameDescription
Public methodDomainRestriction
Initializes a new instance of the DomainRestriction class.
Top
Properties
  NameDescription
Public propertyDomain
Gets the network domain name.
Public propertyExpireDate
Gets or sets the expire date after which the license is no longer valid.
(Inherited from Restriction.)
Public propertyId
Gets the restriction identifier.
(Inherited from Restriction.)
Public propertyName
Gets the restriction name.
(Overrides RestrictionName.)
Public propertyRole
Gets the role associated to this domain.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validates the current domain license restriction.
(Overrides RestrictionValidate(ILicenseContext, Type, Object).)
Top
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();
See Also