Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 2
0
 public static AutomationDialog WaitForDialog(VisualStudioApp app)
 {
     return(new AutomationDialog(app, AutomationElement.FromHandle(app.WaitForDialog())));
 }
Exemplo n.º 3
0
 public IntPtr WaitForDialog()
 {
     return(App.WaitForDialog());
 }