using System;
namespace Wayne.Lib
{
///
/// Factory for creating timers
///
public interface ITimerFactory
{
///
/// Create a timer
///
///
///
///
///
ITimer Create(int id, IIdentifiableEntity parentEntity, string name);
///
/// Creates a timer
///
///
///
///
///
///
///
ITimer Create(int id, IIdentifiableEntity parentEntity, string name, TState state);
}
///
/// Timer changer
///
public interface ITimerChanger : IIdentifiableEntity, IDisposable
{
///
/// Changes the due time and interval of a timer.
///
///
///
///
bool Change(TimeSpan? dueTime, TimeSpan? period);
}
///
/// Delegate fo timeouts.
///
///
///
public delegate void TimoutCallback(object sender, EventArgs e);
///
/// Delegate for timeouts.
///
///
///
///
public delegate void TimoutCallback(object sender, EventArgs e);
///
/// Timer interface.
///
public interface ITimer : ITimerChanger
{
///
/// Fired when the timer fires.
///
event TimoutCallback OnTimeout;
}
///
/// Timer interface for a timer that has an argument.
///
///
public interface ITimer : ITimerChanger
{
///
/// Fired when timer fires.
///
event TimoutCallback OnTimeout;
}
}