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);
                }
            }
        }
示例#2
0
 public IOverwriteFile WaitForOverwriteFileDialog()
 {
     return(OverwriteFileDialog.Wait(App));
 }