示例#1
0
        protected SrmDocument Wait()
        {
            int revision    = WaitRevision;
            var newDocument = _document;

            do
            {
                newDocument = _waitForLoaded
                    ? AbstractFunctionalTest.WaitForDocumentChangeLoaded(newDocument, _waitMillis)
                    : AbstractFunctionalTest.WaitForDocumentChange(newDocument);
            }while (newDocument.RevisionIndex < revision);
            return(newDocument);
        }
示例#2
0
        protected SrmDocument Wait()
        {
            int revision    = WaitRevision;
            var newDocument = _document;

            do
            {
                newDocument = _waitForLoaded
                    ? AbstractFunctionalTest.WaitForDocumentChangeLoaded(newDocument, _waitMillis)
                    : AbstractFunctionalTest.WaitForDocumentChange(newDocument);
            }
            // Unlogged changes can cause a lack of document revision increment
            while (_revisionIncrement.HasValue && newDocument.RevisionIndex < revision);
            return(newDocument);
        }
示例#3
0
        public static void Show(string description = null, string link = null, bool showMatchingPages = false)
        {
            ClipboardEx.UseInternalClipboard(false);

            Form parentWindow = SkylineWindow;

            if (SkylineWindow != null)
            {
                SkylineWindow.UseKeysOverride = false;
            }
            else
            {
                parentWindow = AbstractFunctionalTest.FindOpenForm <StartPage>();
            }

            RunUI(parentWindow, () =>
            {
                var dlg = new PauseAndContinueForm(description, link, showMatchingPages)
                {
                    Left = parentWindow.Left
                };
                const int spacing = 15;
                var screen        = Screen.FromControl(parentWindow);
                if (parentWindow.Top > screen.WorkingArea.Top + dlg.Height + spacing)
                {
                    dlg.Top = parentWindow.Top - dlg.Height - spacing;
                }
                else if (parentWindow.Bottom + dlg.Height + spacing < screen.WorkingArea.Bottom)
                {
                    dlg.Top = parentWindow.Bottom + spacing;
                }
                else
                {
                    dlg.Top = parentWindow.Top;
                    if (parentWindow.Left > screen.WorkingArea.Top + dlg.Width + spacing)
                    {
                        dlg.Left = parentWindow.Left - dlg.Width - spacing;
                    }
                    else if (parentWindow.Right + dlg.Width + spacing < screen.WorkingArea.Right)
                    {
                        dlg.Left = parentWindow.Right + spacing;
                    }
                    else
                    {
                        // Can't fit on screen without overlap, so put in upper left of screen
                        // despite overlap
                        dlg.Top  = screen.WorkingArea.Top;
                        dlg.Left = screen.WorkingArea.Left;
                    }
                }
                dlg.Show(parentWindow);
            });

            lock (_pauseLock)
            {
                // Wait for an event on the pause lock, when the form is closed
                Monitor.Wait(_pauseLock);
                ClipboardEx.UseInternalClipboard();
                if (SkylineWindow != null)
                {
                    RunUI(SkylineWindow, () => SkylineWindow.UseKeysOverride = true);
                }
            }
        }
示例#4
0
 public static void WaitForAuditLogForm(AuditLogForm form)
 {
     AbstractFunctionalTest.WaitForConditionUI(() => form.BindingListSource.IsComplete);
 }