public override sealed async Task RunAsync(IInteractionProvider provider)
 {
     provider.PressKey(key);
     // Use a accurate timer for measuring the time after we need to release the key.
     await provider.WaitAsync(duration, true);
     provider.ReleaseKey(key);
 }
        public override sealed async Task RunAsync(IInteractionProvider provider)
        {
            provider.PressKey(this.key);
            // Use a accurate timer for measuring the time after we need to release the key.
            await provider.WaitAsync(this.duration, true);

            provider.ReleaseKey(this.key);
        }
        public override sealed async Task RunAsync(IInteractionProvider provider)
        {
            // write the text and presses enter.
            if (!pauseDuration.HasValue)
                provider.WriteText(text);
            else
            {
                for (int i = 0; i < text.Length; i++)
                {
                    provider.WriteText(text[i].ToString());
                    await provider.WaitAsync(pauseDuration.Value);
                }
            }

            // A CR LF (\r\n) in the above string would not have the desired effect;
            // instead we need to press the enter key.
            provider.PressKey(AbstractWindowsEnvironment.VirtualKeyShort.Enter);
            await provider.WaitAsync(100);
            provider.ReleaseKey(AbstractWindowsEnvironment.VirtualKeyShort.Enter);
        }
        public override sealed async Task RunAsync(IInteractionProvider provider)
        {
            // write the text and presses enter.
            if (!this.pauseDuration.HasValue)
            {
                provider.WriteText(this.text);
            }
            else
            {
                for (int i = 0; i < this.text.Length; i++)
                {
                    provider.WriteText(this.text[i].ToString());
                    await provider.WaitAsync(this.pauseDuration.Value);
                }
            }

            // A CR LF (\r\n) in the above string would not have the desired effect;
            // instead we need to press the enter key.
            provider.PressKey(AbstractWindowsEnvironment.VirtualKeyShort.Enter);
            await provider.WaitAsync(100);

            provider.ReleaseKey(AbstractWindowsEnvironment.VirtualKeyShort.Enter);
        }