public bool Initialize()
true if the ServiceAdministrator object was successfully initialized.
Check to see if ServiceAdministrator object has been successfully initialized.
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");
}
}
}