Пример #1
0
        public ServiceContainer StopService()
        {
            OnStop();

            this.serviceStatus = ServiceStatusType.Stopped;

            return(this);
        }
Пример #2
0
        public void StarService()
        {
            this.exitEvent.Reset();

            OnStart(args);

            this.serviceStatus = ServiceStatusType.Running;
        }
Пример #3
0
        public ServiceContainer StarService()
        {
            this.exitEvent.Reset();

            OnStart();

            this.serviceStatus = ServiceStatusType.Running;

            return(this);
        }
Пример #4
0
        /// <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);
        }
Пример #5
0
            private int GetWeight(ServiceStatusType type)
            {
                if (type == ServiceStatusType.IssuesFound)
                {
                    return(0);
                }

                if (type == ServiceStatusType.NoConnection)
                {
                    return(1);
                }

                return(type == ServiceStatusType.Healthy
                    ? 2
                    : 3);
            }
Пример #6
0
        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);
Пример #8
0
		public void StopService()
		{
			OnStop();

			this.serviceStatus = ServiceStatusType.Stopped;
		}
Пример #9
0
		public void StarService()
		{
			this.exitEvent.Reset();

			OnStart(args);

			this.serviceStatus = ServiceStatusType.Running;
		}
Пример #10
0
        public void StopService()
        {
            OnStop();

            this.serviceStatus = ServiceStatusType.Stopped;
        }
Пример #11
0
        /// <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);
            }
        }