예제 #1
0
        /// <summary>
        /// Selects the provided items with the mouse preparing for a drag and drop
        /// </summary>
        /// <param name="source"></param>
        private static void SelectItemsForDragAndDrop(AutomationElement[] source)
        {
            AutomationWrapper.Select(source.First());
            for (int i = 1; i < source.Length; i++)
            {
                AutomationWrapper.AddToSelection(source[i]);
            }

            Mouse.MoveTo(source.Last().GetClickablePoint());
            Mouse.Down(MouseButton.Left);
        }
        /// <summary>
        /// Moves one or more items in solution explorer using the keyboard to cut and paste.
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="source"></param>
        private static void MoveByKeyboard(IVisualStudioInstance vs, ITreeNode destination, params ITreeNode[] source)
        {
            AutomationWrapper.Select(source.First());
            for (int i = 1; i < source.Length; i++)
            {
                AutomationWrapper.AddToSelection(source[i]);
            }

            vs.ControlX();

            AutomationWrapper.Select(destination);
            vs.ControlV();
        }
예제 #3
0
        /// <summary>
        /// Moves one or more items in solution explorer using the keyboard to cut and paste.
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="source"></param>
        private static void MoveByKeyboard(AutomationElement destination, params AutomationElement[] source)
        {
            AutomationWrapper.Select(source.First());
            for (int i = 1; i < source.Length; i++)
            {
                AutomationWrapper.AddToSelection(source[i]);
            }

            Keyboard.ControlX();

            AutomationWrapper.Select(destination);
            Keyboard.ControlV();
        }
예제 #4
0
        /// <summary>
        /// Moves one or more items in solution explorer using the keyboard to cut and paste.
        /// </summary>
        /// <param name="destination"></param>
        /// <param name="source"></param>
        private static void MoveByKeyboard(IVisualStudioInstance vs, ITreeNode destination, params ITreeNode[] source)
        {
            AutomationWrapper.Select(source.First());
            for (int i = 1; i < source.Length; i++)
            {
                AutomationWrapper.AddToSelection(source[i]);
            }

            vs.ControlX();

            AutomationWrapper.Select(destination);
            vs.ControlV();
            vs.MaybeCheckMessageBox(TestUtilities.MessageBoxButton.Ok, "One or more files will be");
        }
예제 #5
0
 void ITreeNode.AddToSelection()
 {
     AutomationWrapper.AddToSelection(Element);
 }