public ServiceContainer StopService() { OnStop(); this.serviceStatus = ServiceStatusType.Stopped; return(this); }
public void StarService() { this.exitEvent.Reset(); OnStart(args); this.serviceStatus = ServiceStatusType.Running; }
public ServiceContainer StarService() { this.exitEvent.Reset(); OnStart(); this.serviceStatus = ServiceStatusType.Running; return(this); }
/// <summary> /// Change the ServericeOrder's status, and log an history record for the status change /// </summary> /// <param name="status">The new status for the ServericeOrder</param> /// <param name="currentUserRole">The user requesting the status change</param> public void ChangeStatusTo(ServiceStatusType status, UserRole currentUserRole) { if (currentUserRole == null) { return; } var fromStatus = Status; Status = status; var serviceOrderHistory = ServiceOrderHistory.Create(this, fromStatus, currentUserRole); ServiceOrderHistories.Add(serviceOrderHistory); }
private int GetWeight(ServiceStatusType type) { if (type == ServiceStatusType.IssuesFound) { return(0); } if (type == ServiceStatusType.NoConnection) { return(1); } return(type == ServiceStatusType.Healthy ? 2 : 3); }
public static ServiceOrderHistory Create(ServiceOrder serviceOrder, ServiceStatusType fromStatus, UserRole currentUserRole) { if (serviceOrder == null) { return(null); } if (currentUserRole == null) { return(null); } return(new ServiceOrderHistory { ServiceOrderId = serviceOrder.Id, ServiceOrder = serviceOrder, UserRoleId = currentUserRole.Id, UserRole = currentUserRole, FromStatus = fromStatus, ToStatus = serviceOrder.Status }); }
public static extern bool QueryServiceStatusEx(IntPtr hService, ServiceStatusType statusType, [MarshalAs(UnmanagedType.Struct)] ref SERVICE_STATUS_PROCESS lpBuffer, int cbBufSize, ref int pcbBytesNeeded);
public void StopService() { OnStop(); this.serviceStatus = ServiceStatusType.Stopped; }
/// <summary> /// Called when the status is modified /// </summary> /// <param name="status">The new status</param> protected void OnStatusChange(ServiceStatusType status) { var handler = this.StatusChange; if (handler != null) { handler(this, status); } }