Esempio n. 1
0
		public RequestManager()
		{
			if (!HttpListener.IsSupported)
			{
				throw new InvalidOperationException("Windows XP SP2, Windows Server 2003, or later is required to run this service.");
			}

			var requestHandlers = new RequestHandlerDirectory();
			requestHandlers.AddHandler<ScheduleRequestHandler>("Schedule");
			requestHandlers.AddHandler<CancelRequestHandler>("Cancel");
			requestHandlers.AddHandler<StatusRequestHandler>("Status");

			_Router = new CommandRouter(requestHandlers);
			_ListeningThread = new Thread(new ThreadStart(Listen));
		}
Esempio n. 2
0
        public RequestManager()
        {
            if (!HttpListener.IsSupported)
            {
                throw new InvalidOperationException("Windows XP SP2, Windows Server 2003, or later is required to run this service.");
            }

            var requestHandlers = new RequestHandlerDirectory();

            requestHandlers.AddHandler <ScheduleRequestHandler>("Schedule");
            requestHandlers.AddHandler <CancelRequestHandler>("Cancel");
            requestHandlers.AddHandler <StatusRequestHandler>("Status");

            _Router          = new CommandRouter(requestHandlers);
            _ListeningThread = new Thread(new ThreadStart(Listen));
        }