LEADTOOLS Medical (Leadtools.Dicom.Server.Admin assembly)
LEAD Technologies, Inc

Initialize() Method

Example 





Initializes a ServiceAdministrator object.
Syntax
public bool Initialize()
'Declaration
 
Public Overloads Function Initialize() As Boolean
'Usage
 
Dim instance As ServiceAdministrator
Dim value As Boolean
 
value = instance.Initialize()
public bool Initialize()
 function Leadtools.Dicom.Server.Admin.ServiceAdministrator.Initialize()()
public:
bool Initialize(); 

Return Value

true if the ServiceAdministrator object was successfully intialized.
Example
 
Public Sub LockCheck()
   Dim admin As ServiceAdministrator = New ServiceAdministrator("C:\LEADTOOLS 17.5\Bin\Dotnet\Win32")

   If (Not admin.IsEval) Then
      '
      ' If it isn't an eval then we need to unlock
      '
      If admin.IsLocked Then
         'admin.Unlock("Substitute Your Code")
         Dim MY_LICENSE_FILE As String = "d:\temp\TestLic.lic"
         Dim MY_DEVELOPER_KEY As String = "xyz123abc"

         RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DEVELOPER_KEY)
         If admin.IsLocked Then
            Console.WriteLine("Invalid license")
            Return
         Else
            '
            ' Once unlocked the Services property will be valid
            '
            admin.Initialize()
            For Each service As KeyValuePair(Of String, DicomService) In admin.Services
               Console.WriteLine(service.Value.Settings.AETitle)
               For Each o As IAddInOptions In service.Value.AddInOptions
                  Console.WriteLine("Option: {0}", o.Text)
               Next o
            Next service
         End If
      End If
      Console.WriteLine("License file valid.")
   Else
      If admin.IsExpired Then
         Console.WriteLine("Evaluation has expired")
      End If
   End If
End Sub
public void LockCheck()
{
   ServiceAdministrator admin = new ServiceAdministrator(@"C:\LEADTOOLS 17.5\Bin\Dotnet\Win32");

   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");
      }
   }         
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ServiceAdministrator Class
ServiceAdministrator Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Dicom.Server.Admin requires a Medical toolkit server license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features