Esempio n. 1
0
        /// <summary>
        /// Increments the slider to the specified position
        /// </summary>
        /// <param name="to">New position</param>
        /// <exception cref="ArgumentOutOfRangeException">When <paramref name="to"/> is greater than the maximum value supported</exception>
        /// <exception cref="InvalidOperationException">When <paramref name="to"/> is less than the current value</exception>
        public virtual void Increment(double to)
        {
            if (to > Maximum)
            {
                throw new ArgumentOutOfRangeException("to");
            }

            if (to < Value)
            {
                throw new InvalidOperationException("Can't increment to the specified value. New value should be greater than current value");
            }

            while (Value < to)
            {
                int distance = (int)(to - Value);
                if (distance > LargeChangeAmount)
                {
                    LargeIncrementButton.Click();
                }
                else
                {
                    for (int i = 0; i < distance; i++)
                    {
                        Increment();
                    }
                }
            }
        }
 /// <summary>
 /// Scrolls down by a large amount.
 /// </summary>
 public void ScrollDownLarge()
 {
     LargeIncrementButton.Invoke();
 }
Esempio n. 3
0
 public virtual void ScrollRightLarge()
 {
     LargeIncrementButton.Click();
 }
Esempio n. 4
0
 /// <summary>
 /// Scrolls right by a large amount.
 /// </summary>
 public virtual void ScrollRightLarge()
 {
     LargeIncrementButton.Click(Enums.MouseAction.LeftClick);
 }