Click or drag to resize
TrialRestriction Class
Represents a Restriction typically used to define trial licenses. The trial restriction can limit the number of days the license can be used, the number of application instances that can run simultaneously, the total number of executions and the running time.
Inheritance Hierarchy

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

The TrialRestriction type exposes the following members.

Public methodTrialRestriction
Initializes a new instance of the TrialRestriction class.
Public propertyExpireDate
Gets or sets the expire date after which the license is no longer valid.
(Inherited from Restriction.)
Public propertyExpireDays
Gets the number of days after which the license expires.
Public propertyId
Gets the restriction identifier.
(Inherited from Restriction.)
Public propertyName
Gets the restriction name.
(Overrides RestrictionName.)
Public propertyRunCount
Gets the number of runs after which the license expires.
Public propertyRunInstances
Gets or sets the number of the software instances that are allowed to run simultaneously.
Public propertyRunTime
Gets the time that the software is allowed to run before the license expires.
Public propertyTerms
Gets the license trial terms.
Public propertyTimeLeft
Gets the time remaining before the license expires.
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 trial license restriction.
(Overrides RestrictionValidate(ILicenseContext, Type, Object).)
// Creates a 30 days trial XML license using fluent API
var signer = XmlDigitalSignature.CreateFromKeyFile("Keys.snk");

string licenseXML = new XmlLicense().ForAssembly("ACME.Web, Version=")

//<Licenses xmlns:xsi="">
//  <License>
//    <Assembly name="ACME.Web" version="" />
//    <Restrictions>
//      <Restriction xsi:type="Trial" Id="rD842" expireDays="30" />
//    </Restrictions>
//  </License>
//  <Signature xmlns="">
//    <SignedInfo>
//      <CanonicalizationMethod Algorithm="" />
//      <SignatureMethod Algorithm="" />
//      <Reference URI="">
//        <Transforms>
//          <Transform Algorithm="" />
//        </Transforms>
//        <DigestMethod Algorithm="" />
//        <DigestValue>KOKohrsJWwhuuixC1o/gIv5wUtU=</DigestValue>
//      </Reference>
//    </SignedInfo>
//    <SignatureValue>fcUu...</SignatureValue>
//  </Signature>
See Also