Exemplo n.º 1
0
        /// <summary>
        /// Processes the rule for this filter.
        /// The action stack can be modified by the filter if it matches it's filtering criteria.
        /// </summary>
        /// <param name="actionStack">The action stack.</param>
        /// <returns>True if no more filtering should be done in this cycle. False if the
        /// filtering should continue with action filters that follow.</returns>
        public override bool ProcessRule(IUITestActionStack actionStack)
        {
            // Remove the mouse click preceeding on send keys on the same Excel cell.
            SendKeysAction lastAction       = actionStack.Peek() as SendKeysAction;
            MouseAction    secondLastAction = actionStack.Peek(1) as MouseAction;

            if (IsLeftClick(secondLastAction) &&
                AreActionsOnSameWordSelection(lastAction, secondLastAction))
            {
                // This is left click on a cell preceding a typing on the same cell.
                // Remove the left click action.
                // (0 means top-most action and 1 means 2nd action & so on.)
                actionStack.Pop(1);
            }

            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Processes the rule for this filter. 
        /// The action stack can be modified by the filter if it matches it's filtering criteria.
        /// </summary>
        /// <param name="actionStack">The action stack.</param>
        /// <returns>True if no more filtering should be done in this cycle. False if the 
        /// filtering should continue with action filters that follow.</returns>
        public override bool ProcessRule(IUITestActionStack actionStack)
        {
            // Remove the mouse click preceeding on send keys on the same Excel cell.
            SendKeysAction lastAction = actionStack.Peek() as SendKeysAction;
            MouseAction secondLastAction = actionStack.Peek(1) as MouseAction;

            if (IsLeftClick(secondLastAction) &&
                AreActionsOnSameExcelCell(lastAction, secondLastAction))
            {
                // This is left click on a cell preceding a typing on the same cell.
                // Remove the left click action.
                // (0 means top-most action and 1 means 2nd action & so on.)
                actionStack.Pop(1);
            }

            return false;
        }