Licensing in .NET
By Myk Willis, October 01, 2003
The Microsoft.NET licensing model works well for the kind of redistributable components that developers buy and redistribute as a part of an application. In this article, we'll enable licensing support for a simple redistributable component, and see how Visual Studio .NET automates much of the licensing process for components.
Licensing in .NET
Listing 5 A license object derived from System.ComponentModel.License
using System;
using System.ComponentModel;
public class CustomLicense : License
{
string licenseKey;
bool isEvaluation;
public override void Dispose() {}
public override string LicenseKey
{ get { return licenseKey; } }
public bool IsEvaluation
{ get { return isEvaluation; } }
public CustomLicense(string licenseKey, bool isEvaluation)
{
this.licenseKey = licenseKey;
this.isEvaluation = isEvaluation;
}
}