/// <summary> /// Gets the dialog watcher for the specified process. It creates /// a new instance if no dialog watcher for the specified process /// exists. /// </summary> /// <param name="ieProcessId">The ie process id.</param> /// <returns></returns> public static DialogWatcher GetDialogWatcherForProcess(int ieProcessId) { CleanupDialogWatcherCache(); DialogWatcher dialogWatcher = GetDialogWatcherFromCache(ieProcessId); // If no dialogwatcher exists for the ieprocessid then // create a new one, store it and return it. if (dialogWatcher == null) { dialogWatcher = new DialogWatcher(ieProcessId); dialogWatchers.Add(dialogWatcher); } return(dialogWatcher); }
/// <summary> /// Starts the dialog watcher. /// </summary> private void StartDialogWatcher() { if (ItiNdialogWatcher == null) { ItiNdialogWatcher = DialogWatcher.GetDialogWatcherForProcess(ProcessId); ItiNdialogWatcher.IncreaseReferenceCount(); } }
/// <summary> /// Gets the dialog watcher for the specified process. It creates /// a new instance if no dialog watcher for the specified process /// exists. /// </summary> /// <param name="ieProcessId">The ie process id.</param> /// <returns></returns> public static DialogWatcher GetDialogWatcherForProcess(int ieProcessId) { CleanupDialogWatcherCache(); DialogWatcher dialogWatcher = GetDialogWatcherFromCache(ieProcessId); // If no dialogwatcher exists for the ieprocessid then // create a new one, store it and return it. if (dialogWatcher == null) { dialogWatcher = new DialogWatcher(ieProcessId); dialogWatchers.Add(dialogWatcher); } return dialogWatcher; }