Show / Hide Table of Contents

Class License

Provides the abstract base class for all licenses. A license is granted to an assembly signed with a strong name.

Inheritance
System.Object
Freezable<LicenseProviderAttribute>
License
AssemblyLicense
MachineLicense
UserLicense
Inherited Members
Freezable<LicenseProviderAttribute>.VerifyFrozenAccess()
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: DevZest.Licensing
Assembly: DevZest.Licensing.dll
Syntax
public abstract class License : Freezable<LicenseProviderAttribute>
Remarks

A License is created and signed by LicensePublisher which normally implemented as web service. The LicenseClient communicates with the LicensePublisher, gets the published license and stores it somewhere that can be loaded by the LicenseProviderAttribute declared as assembly attribute. To determine whether an assembly can be granted a valid license, the license provider attributes are retrieved to provide an instance of License object containing a collection of LicenseItem objects. The validation is then performed on the License object and the LicenseItem object matching the specified license item name.

Before performing the validation on the LicenseItem object, the license provider seals the License object by setting its IsFrozen property to true. Any attempting to modify the License object throws an System.InvalidOperationException. All derived classes should respect this rule by calling VerifyFrozenAccess() in all public methods and property setters that might modify the object.

Constructors

Name Description
License()

Initializes a new instance of the License class

Properties

Name Description
Assembly

Gets the assembly this license is granted to.

Category

Gets or sets the license category information.

Company

Gets or sets product company information.

Data

Gets or sets the data that the validation is performed against.

Expiration

Gets or sets the expiration date, as string, of this license.

ExpirationDate

Gets the expiration date of this license.

Id

Gets or sets the license ID information.

IsExpired

Gets a value indicating whether this license is expired.

IsFrozen
Item[String]

Gets the LicenseItem object for specified name.

Items

Gets a collection of LicenseItem objects.

Product

Gets or sets product name information.

Provider

Gets the license provider which provides this license. License providers are declared as assembly level attributes.

ProviderData

Gets the data set by the license provider.

SignedString

Gets or sets the XAML string that can be converted from/to this License object, signed by the assembly private key.

UpgradeExpiration

Gets or sets the upgrade expiration date, as string, of this license.

UpgradeExpirationDate

Gets the upgrade expiration date of this license.

UserCompany

Gets or sets the user company information.

UserName

Gets or sets the user name information.

Methods

Name Description
LoadFromXaml(String)

Loads the license from XAML string.

SetExpirationDate(DateTime)

Sets the expiration date of this license.

SetUpgradeExpirationDate(DateTime)

Sets the upgrade expiration date of this license.

Validate()

Determines whether valid license can be granted.

  • Improve this Doc
  • View Source
Back to top Copyright © Weifen Luo | DevZest