Пример #1
0
        /// <summary>
        /// Adds the instruction or increments the repetitions.
        /// </summary>
        /// <param name="instruction">The instruction.</param>
        /// <returns></returns>
        private bool AddOrIncrement(Instructions.Instruction instruction)
        {
            int delay = GetDelay();

            if (currentInstruction == null || currentRun == null)
            {
                currentInstruction = instruction;
            }
            else if (instruction.Resembles(currentInstruction) &&
                     instruction is Wheel wheel && delay < MOUSE_REPETITION_MAX_DELAY)
            {
                ((Wheel)currentInstruction).ScrollDistance.Inc(wheel.ScrollDistance.Value);
            }