Class ActionExtensions
Useful extension methods for System.Action.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
Namespace: IRM
Assembly: IRM.dll
Syntax
public static class ActionExtensions
Methods
Debounce(Action, Int32)
Debounce an System.Action by resetting the timeout every time it is invoked, effectevly only executing the Action after timeout has fully elapsed.
Declaration
public static Action Debounce(this Action action, int milliseconds = 300)
Parameters
System.Action
action
The System.Action to execute when debounce event fires. |
System.Int32
milliseconds
The timeout in milliseconds. |
Returns
System.Action
A debounced action to invoke instead of the supplied Action. |
Debounce(Action, TaskScheduler, Int32)
Debounce an System.Action by resetting the timeout every time it is invoked, effectevly only executing the Action after timeout has fully elapsed.
Declaration
public static Action Debounce(this Action action, TaskScheduler taskScheduler, int milliseconds = 300)
Parameters
System.Action
action
The System.Action to execute when debounce event fires. |
TaskScheduler
taskScheduler
The TaskScheduler to use for the execution of the |
System.Int32
milliseconds
The timeout in milliseconds. |
Returns
System.Action
A debounced action to invoke instead of the supplied Action. |