C# Класс fCraft.ChatTimer

Provides a way to create and manage publicly-announced countdowns. Long timers announce once an hour (e.g. "7h left"). During the last hour, timer announces more often: every 10 minutes, then every minute, then every 10 seconds, and finally every second - until the timer is up.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ID int
Id int
MinDuration System.TimeSpan

Private Properties

Свойство Тип Описание
AddTimerToList void
Announce void
ChatTimer System
FindTimerByID ChatTimer
FindTimerById ChatTimer
RaiseStartedEvent void
RaiseStartedEvent void
RaiseStoppedEvent void
RaiseStoppedEvent void
RemoveTimerFromList void
Stop void
TimerCallback void

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

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

Stops this timer, and removes it from the list of timers.

Start ( System.TimeSpan duration, [ message, [ startedBy ) : ChatTimer

Starts this timer with the specified duration, and end message.

Stop ( ) : void

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

Метод Описание
AddTimerToList ( [ timer ) : void
Announce ( System.TimeSpan timeLeft ) : void
ChatTimer ( System.TimeSpan duration, [ message, [ startedBy ) : System
FindTimerByID ( int id ) : ChatTimer
FindTimerById ( int id ) : ChatTimer
RaiseStartedEvent ( ChatTimer timer ) : void
RaiseStartedEvent ( [ timer ) : void
RaiseStoppedEvent ( ChatTimer timer ) : void
RaiseStoppedEvent ( [ timer ) : void
RemoveTimerFromList ( [ timer ) : void
Stop ( bool aborted ) : void
TimerCallback ( [ task ) : void

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

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

Stops this timer, and removes it from the list of timers.
public Abort ( ) : void
Результат void

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

Starts this timer with the specified duration, and end message.
startedBy is null. duration is less than ChatTimer.MinDuration.
public static Start ( System.TimeSpan duration, [ message, [ startedBy ) : ChatTimer
duration System.TimeSpan Amount of time the timer should run before completion. Should not be less than ChatTimer.MinDuration.
message [ Message to display when timer reaches zero. May be null.
startedBy [ Name of player who started timer. May not be null.
Результат ChatTimer

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

public Stop ( ) : void
Результат void

Описание свойств

ID публичное свойство

Timer's unique numeric ID.
public int ID
Результат int

Id публичное свойство

public int Id
Результат int

MinDuration публичное статическое свойство

Minimum allowed timer duration (one second).
public static TimeSpan,System MinDuration
Результат System.TimeSpan