public KeyboardInputAsyncResult (
			KeyboardInputViewController viewController, AsyncCallback callback, object asyncState)
		{
			if (viewController == null)
				throw new ArgumentNullException ("viewController");

			_viewController = viewController;
			_callback = callback;
			_asyncState = asyncState;
			_asyncWaitHandle = new Lazy<ManualResetEvent>(
				() => new ManualResetEvent(false),
				LazyThreadSafetyMode.ExecutionAndPublication);

			_viewController.View.InputAccepted += ViewController_InputAccepted;
			_viewController.View.InputCanceled += ViewController_InputCanceled;
		}
Example #2
0
        public KeyboardInputAsyncResult(
            KeyboardInputViewController viewController, AsyncCallback callback, object asyncState)
        {
            if (viewController == null)
            {
                throw new ArgumentNullException("viewController");
            }

            _viewController  = viewController;
            _callback        = callback;
            _asyncState      = asyncState;
            _asyncWaitHandle = new Lazy <ManualResetEvent>(
                () => new ManualResetEvent(false),
                LazyThreadSafetyMode.ExecutionAndPublication);

            _viewController.View.InputAccepted += ViewController_InputAccepted;
            _viewController.View.InputCanceled += ViewController_InputCanceled;
        }