예제 #1
0
        private void CreateNewIEAndGoToUri(Uri uri, IDialogHandler logonDialogHandler, bool createInNewProcess)
        {
            CheckThreadApartmentStateIsSTA();

            UtilityClass.MoveMousePoinerToTopLeft(Settings.AutoMoveMousePointerToTopLeft);

            if (createInNewProcess)
            {
                Logger.LogAction("Creating IE instance in a new process");

                _ieBrowser = CreateIEPartiallyInitializedInNewProcess();
            }
            else
            {
                Logger.LogAction("Creating IE instance");

                _ieBrowser = CreateIEBrowser(new InternetExplorerClass());
            }

            StartDialogWatcher();

            if (logonDialogHandler != null)
            {
                // remove other logon dialog handlers since only one handler
                // can effectively handle the logon dialog.
                DialogWatcher.RemoveAll(new LogonDialogHandler("a", "b"));

                // Add the (new) logonHandler
                DialogWatcher.Add(logonDialogHandler);
            }

            FinishInitialization(uri);

//            WaitForComplete();
        }
예제 #2
0
        public override void WaitForComplete(int waitForCompleteTimeOut)
        {
            if (hasDialogHandler == null)
            {
                hasDialogHandler = new HasDialogHandler();
                DialogWatcher.Add(hasDialogHandler);
            }

            WaitForComplete(new IEWaitForCompleteWithDialogs((IEBrowser)NativeBrowser, waitForCompleteTimeOut, hasDialogHandler.HasDialog));
        }
예제 #3
0
        public UseDialogOnce(DialogWatcher watcher, IDialogHandler handler)
        {
            if (watcher == null)
            {
                throw new ArgumentNullException("watcher");
            }
            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            _watcher = watcher;
            _handler = handler;

            watcher.Add(handler);
        }
 /// <summary>
 /// Adds the dialog handler.
 /// </summary>
 /// <param name="handler">The dialog handler.</param>
 public void AddDialogHandler(IDialogHandler handler)
 {
     DialogWatcher.Add(handler);
 }