public bool IsLocked { get; }
true if the framework is locked, otherwise it is false.
using Leadtools;
using Leadtools.Dicom.AddIn.Common;
using Leadtools.Dicom.AddIn.Interfaces;
public void LockCheck()
{
ServiceAdministrator admin = new ServiceAdministrator(LEAD_VARS.InstallWin32Dir);
if (!admin.IsEval)
{
//
// If it isn't an eval then we need to set the license file.
//
if (admin.IsLocked)
{
//admin.Unlock("Substitute Your Code");
string MY_LICENSE_FILE = "d:\\temp\\TestLic.lic";
string MY_DEVELOPER_KEY = "xyz123abc";
RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DEVELOPER_KEY);
if (admin.IsLocked)
{
Console.WriteLine("Invalid license");
return;
}
else
{
//
// Once unlocked initialize the services
//
admin.Initialize();
foreach (KeyValuePair<string, DicomService> service in admin.Services)
{
Console.WriteLine(service.Value.Settings.AETitle);
foreach (IAddInOptions option in service.Value.AddInOptions)
{
Console.WriteLine("Option: {0}", option.Text);
}
}
}
}
Console.WriteLine("License file valid.");
}
else
{
if (admin.IsExpired)
{
Console.WriteLine("Evaluation has expired");
}
}
}