Beispiel #1
0
        public static OverwriteFileDialog Wait(VisualStudioApp app)
        {
            var hwnd = app.WaitForDialog();

            Assert.AreNotEqual(IntPtr.Zero, hwnd, "Did not find OverwriteFileDialog");
            var element = AutomationElement.FromHandle(hwnd);

            try {
                Assert.IsNotNull(element.FindFirst(
                                     TreeScope.Descendants,
                                     new PropertyCondition(AutomationElement.AutomationIdProperty, "_allItems")
                                     ), "Not correct dialog - missing '_allItems'");
                Assert.IsNotNull(element.FindFirst(
                                     TreeScope.Descendants,
                                     new PropertyCondition(AutomationElement.AutomationIdProperty, "_yes")
                                     ), "Not correct dialog - missing '_yes'");

                var res = new OverwriteFileDialog(app, element);
                element = null;
                return(res);
            } finally {
                if (element != null)
                {
                    AutomationWrapper.DumpElement(element);
                }
            }
        }
Beispiel #2
0
        public static OverwriteFileDialog Wait(VisualStudioApp app) {
            var hwnd = app.WaitForDialog();
            Assert.AreNotEqual(IntPtr.Zero, hwnd, "Did not find OverwriteFileDialog");
            var element = AutomationElement.FromHandle(hwnd);

            try {
                Assert.IsNotNull(element.FindFirst(
                    TreeScope.Descendants,
                    new PropertyCondition(AutomationElement.AutomationIdProperty, "_allItems")
                ), "Not correct dialog - missing '_allItems'");
                Assert.IsNotNull(element.FindFirst(
                    TreeScope.Descendants,
                    new PropertyCondition(AutomationElement.AutomationIdProperty, "_yes")
                ), "Not correct dialog - missing '_yes'");

                var res = new OverwriteFileDialog(app, element);
                element = null;
                return res;
            } finally {
                if (element != null) {
                    AutomationWrapper.DumpElement(element);
                }
            }
        }
Beispiel #3
0
 public IOverwriteFile WaitForOverwriteFileDialog()
 {
     return(OverwriteFileDialog.Wait(App));
 }