LEADTOOLS Medical (Leadtools.Dicom.Server.Admin assembly)

Initialize() Method

Show in webframe
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(); 

Return Value

true if the ServiceAdministrator object was successfully intialized.
Example
Copy Code  
Imports Leadtools

Imports Leadtools.Dicom.AddIn.Common

Imports Leadtools.Dicom.AddIn.Interfaces


Public Sub LockCheck()
      Dim admin As ServiceAdministrator = New ServiceAdministrator("C:\LEADTOOLS 18\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
using Leadtools;

using Leadtools.Dicom.AddIn.Common;

using Leadtools.Dicom.AddIn.Interfaces;


public void LockCheck()
{
   ServiceAdministrator admin = new ServiceAdministrator(@"C:\LEADTOOLS 18\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

See Also

Reference

ServiceAdministrator Class
ServiceAdministrator Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 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