UtilConsoleSpinCursorTask Method
Asynchronously animates the console cursor producing a spin effect.
Namespace: DevCase.Core.Application.ConsoleAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
static member SpinCursorTask :
cancellationToken : CancellationToken *
?speed : int
(* Defaults:
let _speed = defaultArg speed 100
*)
-> Task
No code example is currently available or this language may not be supported.
- cancellationToken CancellationToken
-
A CancellationToken that you must use to cancel this Task.
- speed Int32 (Optional)
-
The timeout, in milliseconds, between each movement of the animation. The spin animation has 4 movements.
Default value is 100.
Task
A
Task object to asynchronously animate the console cursor producing a spin effect.
This is a code example.
No code example is currently available or this language may not be supported.
Console.Write("Loading...")
Dim spinCancelation As New CancellationTokenSource
Dim spinTask As Task = SpinCursorAsync(spinCancelation.Token)
spinTask.Start()
' Do some work while the cursor is spinning...
For x As Integer = 0 To 50
Thread.Sleep(100)
Debug.WriteLine(x)
Next
' Work is done, so terminate the spin task.
spinCancelation.Cancel()
spinTask.Wait()
Console.Write(" Finished.")
Console.ReadKey()
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.