示例#1
0
		public void Start()
		{
			this.WriteDebugMessage(string.Format("Starting {0}.", GetType().FullName));

			State = HostedServiceState.Started;
			OnStart();

			this.WriteInfoMessage("Started {0}.", GetType().Name);
		}
示例#2
0
		public void Cancel()
		{
			this.WriteDebugMessage(string.Format("Cancelling {0}.", GetType().FullName));

			State = HostedServiceState.Stopping;
			OnStop();
			State = HostedServiceState.Stopped;

			this.WriteInfoMessage("Cancelled {0}.", GetType().Name);
		}