UtilServicingSetStatus(String, ServiceStatus, Boolean, Boolean) Method
Sets the status of a service.
Namespace: DevCase.Core.Windows.ServicingAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void SetStatus(
string svcName,
ServiceStatus status,
bool wait = false,
bool throwOnStatusMissmatch = false
)
Public Shared Sub SetStatus (
svcName As String,
status As ServiceStatus,
Optional wait As Boolean = false,
Optional throwOnStatusMissmatch As Boolean = false
)
Dim svcName As String
Dim status As ServiceStatus
Dim wait As Boolean
Dim throwOnStatusMissmatch As Boolean
UtilServicing.SetStatus(svcName, status, wait,
throwOnStatusMissmatch)
public:
static void SetStatus(
String^ svcName,
ServiceStatus status,
bool wait = false,
bool throwOnStatusMissmatch = false
)
static member SetStatus :
svcName : string *
status : ServiceStatus *
?wait : bool *
?throwOnStatusMissmatch : bool
(* Defaults:
let _wait = defaultArg wait false
let _throwOnStatusMissmatch = defaultArg throwOnStatusMissmatch false
*)
-> unit
No code example is currently available or this language may not be supported.
Parameters
- svcName String
-
The service name.
- status ServiceStatus
-
The target service status.
- wait Boolean (Optional)
-
if set to waits for the status change completition.
- throwOnStatusMissmatch Boolean (Optional)
-
If set to , throws an error when attempting to start a service that is started,
or attempting to stop a service that is stopped.
This is a code example.
No code example is currently available or this language may not be supported.
Servicing.SetStatus("themes", ServiceStatus.Stop, wait:=True, throwOnStatusMissmatch:=True)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentException
|
Any service found with the specified name.;svcName
|
ServiceDependancyDisabledException
|
Cannot start service because a dependant service is disabled.
|
Exception
|
Cannot start or stop service because it is disabled.
or
The service is already running or pendng to run it.
or
The service is already stopped or pendng to stop it.
|
InvalidEnumArgumentException
|
status
|