public async Task Run(TypewriterBuilder builder)
        {
            for (int i = 0; i < str.Length; i++)
            {
                builder.DisplayText += str[i];

                await Task.Delay(characterPause);
            }
        }
        public Task Run(TypewriterBuilder builder)
        {
            if (hasRan)
            {
                return(Task.CompletedTask);
            }

            hasRan = true;

            return(Task.Delay(milliseconds));
        }
示例#3
0
        public async Task Run(TypewriterBuilder builder)
        {
            int charaterCount = deleteAll ? builder.DisplayText.Length : numberOfCharacters;

            while (charaterCount > 0 && builder.DisplayText.Length > 0)
            {
                builder.DisplayText = builder.DisplayText.Substring(0, builder.DisplayText.Length - 1);
                charaterCount--;

                await Task.Delay(characterPause);
            }
        }
示例#4
0
 public Task Run(TypewriterBuilder builder)
 {
     return(Task.Delay(milliseconds));
 }