←Select platform

ServiceControllerExtensions Class

Summary

A class containing extension methods for the ServiceController class.

Syntax
C#
C++/CLI
public static class ServiceControllerExtensions 
public: 
   [ExtensionAttribute] 
   ref class ServiceControllerExtensions sealed abstract 
Remarks

This class contains extensions methods to set the Windows Service start mode to any valid start mode including "Automatic (Delayed Start)".

A specific DICOM listening service (or any windows service) is configured to have a startup type:

Start mode Description
Automatic The DICOM listening service automatically starts during the boot and logon process.
Manual The DICOM listening service does not automatically start during boot and logon, but may be launched by Windows if needed.
Disabled Use this setting to disable the DICOM listening service. Disabling the service prevents the service from starting.
AutomaticDelayedStart Similar to Automatic, except the DICOM listening service is briefly delayed during the logon process to increase logon performance.
Example

This example shows how the ServiceControllerExtensions class can be used to set the StartMode for a Windows Service.

C#
using Leadtools.Dicom.AddIn; 
using Leadtools.Dicom.AddIn.Common; 
using Leadtools.Dicom.Server.Admin; 
 
 
public static void Example_ServerControllerExtensions() 
{ 
   using (ServiceController sc = new ServiceController("L22_PACS_SCP64")) 
   { 
      // Set start modes using constants 
      sc.SetStartMode(ServiceStartModeExtended.Disabled); 
      sc.SetStartMode(ServiceStartModeExtended.Manual); 
      sc.SetStartMode(ServiceStartModeExtended.Automatic); 
      sc.SetStartMode(ServiceStartModeExtended.AutomaticDelayedStart); 
 
      // Set start modes using strings 
      sc.SetStartMode("Disabled"); 
      sc.SetStartMode("Manual"); 
      sc.SetStartMode("Automatic"); 
      sc.SetStartMode("AutomaticDelayedStart"); 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2023.2.9
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Dicom.Server.Admin Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.