C# Класс Hourglass.Timing.Timer

A countdown timer.
Наследование: Hourglass.Timing.TimerBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FromTimerInfo ( Hourglass.Serialization.TimerInfo timerInfo ) : Timer

Returns a Timer for a TimerInfo.

Start ( TimerStart newTimerStart ) : bool

Starts the timer.

Timer ( ) : System

Initializes a new instance of the Timer class.

Timer ( Hourglass.Serialization.TimerInfo timerInfo ) : System

Initializes a new instance of the Timer class.

Timer ( TimerOptions options ) : System

Initializes a new instance of the Timer class.

ToString ( ) : string

Returns a string that represents the current object.

ToTimerInfo ( ) : Hourglass.Serialization.TimerInfo

Returns the representation of the TimerInfo used for XML serialization.

Защищенные методы

Метод Описание
OnExpired ( ) : void

Invoked before the TimerBase.Expired event is raised

OnPaused ( ) : void

Invoked before the TimerBase.Paused event is raised

OnResumed ( ) : void

Invoked before the TimerBase.Resumed event is raised

OnStarted ( ) : void

Invoked before the TimerBase.Started event is raised

OnStopped ( ) : void

Invoked before the TimerBase.Stopped event is raised

OnTick ( ) : void

Invoked before the TimerBase.Tick event is raised

Приватные методы

Метод Описание
GetTimeElapsedAsPercentage ( ) : double?

Returns the percentage of time elapsed since the timer was started.

GetTimeElapsedAsString ( ) : string

Returns the string representation of the time elapsed since the timer was started.

GetTimeExpiredAsString ( ) : string

Returns the string representation of the time since the timer expired.

GetTimeLeftAsPercentage ( ) : double?

Returns the percentage of time left until the timer expires.

GetTimeLeftAsString ( ) : string

Returns the string representation of the time left until the timer expires.

Loop ( ) : void

Restarts the timer with the current TimerStart.

UpdateHourglassTimer ( ) : void

Updates the Timer state.

Описание методов

FromTimerInfo() публичный статический Метод

Returns a Timer for a TimerInfo.
public static FromTimerInfo ( Hourglass.Serialization.TimerInfo timerInfo ) : Timer
timerInfo Hourglass.Serialization.TimerInfo A .
Результат Timer

OnExpired() защищенный Метод

Invoked before the TimerBase.Expired event is raised
protected OnExpired ( ) : void
Результат void

OnPaused() защищенный Метод

Invoked before the TimerBase.Paused event is raised
protected OnPaused ( ) : void
Результат void

OnResumed() защищенный Метод

Invoked before the TimerBase.Resumed event is raised
protected OnResumed ( ) : void
Результат void

OnStarted() защищенный Метод

Invoked before the TimerBase.Started event is raised
protected OnStarted ( ) : void
Результат void

OnStopped() защищенный Метод

Invoked before the TimerBase.Stopped event is raised
protected OnStopped ( ) : void
Результат void

OnTick() защищенный Метод

Invoked before the TimerBase.Tick event is raised
protected OnTick ( ) : void
Результат void

Start() публичный Метод

Starts the timer.
If the timer has been disposed.
public Start ( TimerStart newTimerStart ) : bool
newTimerStart TimerStart A .
Результат bool

Timer() публичный Метод

Initializes a new instance of the Timer class.
public Timer ( ) : System
Результат System

Timer() публичный Метод

Initializes a new instance of the Timer class.
public Timer ( Hourglass.Serialization.TimerInfo timerInfo ) : System
timerInfo Hourglass.Serialization.TimerInfo A representing the state of the .
Результат System

Timer() публичный Метод

Initializes a new instance of the Timer class.
public Timer ( TimerOptions options ) : System
options TimerOptions Configuration data for this timer.
Результат System

ToString() публичный Метод

Returns a string that represents the current object.
public ToString ( ) : string
Результат string

ToTimerInfo() публичный Метод

Returns the representation of the TimerInfo used for XML serialization.
public ToTimerInfo ( ) : Hourglass.Serialization.TimerInfo
Результат Hourglass.Serialization.TimerInfo