C# Class Brass9.Threading.TimerInfo

A wrapper class for System.Threading.Timer * Eliminates context object to pass in - just use a closure instead. * Allows you to check on the current Interval the timer is set to. * Uses just the one callback per timer - if you need a new callback, make a new TimerInfo. * Simplifies changing schedule of timer. * Easier to check on when it ran (check LastFired).
Afficher le fichier Open project: b9chris/ASP.Net-Long-Running-Interval-Task Class Usage Examples

Protected Properties

Свойство Type Description
timer System.Threading.Timer
timerCallback System.Action

Méthodes publiques

Méthode Description
SetInterval ( int milliseconds ) : void
Stop ( ) : void
TimerInfo ( System.Action timerCallback ) : System

Setup a TimerInfo object.

Method Details

SetInterval() public méthode

public SetInterval ( int milliseconds ) : void
milliseconds int
Résultat void

Stop() public méthode

public Stop ( ) : void
Résultat void

TimerInfo() public méthode

Setup a TimerInfo object.
public TimerInfo ( System.Action timerCallback ) : System
timerCallback System.Action The Action to call each time the Timer fires. Does away with a context object argument - use a closure instead.
Résultat System

Property Details

timer protected_oe property

protected Timer,System.Threading timer
Résultat System.Threading.Timer

timerCallback protected_oe property

protected Action,System timerCallback
Résultat System.Action