Example #1
0
        public void VerifyClosed(string dialogName)
        {
            using var cancellationTokenSource = new CancellationTokenSource(Helper.HangMitigatingTimeout);

            // FindDialog will wait until the dialog is closed, so the return value is unused.
            DialogHelpers.FindDialogByName(GetMainWindowHWnd(), dialogName, isOpen: false, cancellationTokenSource.Token);
        }
 public void VerifyClosed(string expectedTitle) =>
 DialogHelpers.FindDialogByName(
     GetMainWindowHWnd(),
     expectedTitle,
     isOpen: false,
     CancellationToken.None
     );
Example #3
0
        /// <summary>
        /// Verifies that the Preview Changes dialog is showing with the
        /// specified title. The dialog does not have an AutomationId and the
        /// title can be changed by features, so callers of this method must
        /// specify a title.
        /// </summary>
        /// <param name="expectedTitle"></param>
        public void VerifyOpen(string expectedTitle)
        {
            DialogHelpers.FindDialogByName(GetMainWindowHWnd(), expectedTitle, isOpen: true);

            // Wait for application idle to ensure the dialog is fully initialized
            VisualStudioInstance.WaitForApplicationIdle();
        }
Example #4
0
        public void VerifyOpen(string dialogName)
        {
            // FindDialog will wait until the dialog is open, so the return value is unused.
            DialogHelpers.FindDialogByName(GetMainWindowHWnd(), dialogName, isOpen: true, CancellationToken.None);

            // Wait for application idle to ensure the dialog is fully initialized
            VisualStudioInstance.WaitForApplicationIdle(CancellationToken.None);
        }
Example #5
0
        public void VerifyOpen(string dialogName)
        {
            using var cancellationTokenSource = new CancellationTokenSource(Helper.HangMitigatingTimeout);

            // FindDialog will wait until the dialog is open, so the return value is unused.
            DialogHelpers.FindDialogByName(GetMainWindowHWnd(), dialogName, isOpen: true, cancellationTokenSource.Token);

            // Wait for application idle to ensure the dialog is fully initialized
            VisualStudioInstance.WaitForApplicationIdle(cancellationTokenSource.Token);
        }
        /// <summary>
        /// Verifies that the Preview Changes dialog is showing with the
        /// specified title. The dialog does not have an AutomationId and the
        /// title can be changed by features, so callers of this method must
        /// specify a title.
        /// </summary>
        /// <param name="expectedTitle"></param>
        public void VerifyOpen(string expectedTitle, TimeSpan?timeout = default)
        {
            using (var cancellationTokenSource = timeout != null ? new CancellationTokenSource(timeout.Value) : null)
            {
                var cancellationToken = cancellationTokenSource?.Token ?? CancellationToken.None;
                DialogHelpers.FindDialogByName(GetMainWindowHWnd(), expectedTitle, isOpen: true, cancellationToken);

                // Wait for application idle to ensure the dialog is fully initialized
                VisualStudioInstance.WaitForApplicationIdle(cancellationToken);
            }
        }
Example #7
0
 public void VerifyClosed(string dialogName)
 {
     // FindDialog will wait until the dialog is closed, so the return value is unused.
     DialogHelpers.FindDialogByName(GetMainWindowHWnd(), dialogName, isOpen: false);
 }
 /// <summary>
 /// Verifies that the Preview Changes dialog is showing with the
 /// specified title. The dialog does not have an AutomationId and the
 /// title can be changed by features, so callers of this method must
 /// specify a title.
 /// </summary>
 /// <param name="expectedTitle"></param>
 public void VerifyOpen(string expectedTitle)
 => DialogHelpers.FindDialogByName(GetMainWindowHWnd(), expectedTitle, isOpen: true);