/// <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(); }
/// <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(); }
/// <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"); }
void ITreeNode.AddToSelection() { AutomationWrapper.AddToSelection(Element); }