Click or drag to resize
BetaRestriction Class
Defines a Restriction typically used to tag the license with beta release information. Setting an expire date for this restriction will allow to deliver software beta releases, valid for a limited time, before the delivery of the live release.
Inheritance Hierarchy

Namespace:  Babel.Licensing
Assemblies:   Babel.Licensing (in Babel.Licensing.dll) Version:
  Babel.Licensing (in Babel.Licensing.dll) Version:
public class BetaRestriction : Restriction

The BetaRestriction type exposes the following members.

Public methodBetaRestriction
Initializes a new instance of the BetaRestriction class.
Public propertyBuildType
Gets the type of the build for this beta release.
Public propertyExpireDate
Gets or sets the expire date after which the license is no longer valid.
(Inherited from Restriction.)
Public propertyId
Gets or sets the restriction identifier.
(Inherited from Restriction.)
Public propertyListeners
Gets the listeners.
(Inherited from Restriction.)
Public propertyName
Gets the restriction name.
(Overrides RestrictionName.)
Public propertyRecentChanges
Gets this beta recent changes.
Public methodAttach
Attaches the given listener.
(Inherited from Restriction.)
Public methodDetach
Detaches the given listener.
(Inherited from Restriction.)
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 the default hash function.
(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 methodNotify
Notifies registered listeners.
(Inherited from Restriction.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validates the current restriction object.
(Inherited from Restriction.)
// Creates a 30 days XML license for beta software 
var license = new XmlLicense();

// Add a beta information
BetaRestriction beta = new BetaRestriction();
beta.Id = "beta099";
beta.ExpireDate = DateTime.Today.AddDays(30);
beta.RecentChanges = "Added new user management";
beta.BuildType = "Beta";


// Generate the license key
var signer = XmlDigitalSignature.CreateFromKeyFile("Keys.snk");
string licenseXml = license.SignWith(signer).ToReadableString();
See Also