using System; namespace ThunderboltTimeSync.TimeProviders { /// /// Called when the time provider has a new time and date available. /// /// The current time and date, according to the time provider. public delegate void TimeAvailableEventHandler(DateTime dateTime); /// /// Called when the time provider wishes to log a message or an error. /// /// The message for the log. /// True if the message constitutes an error, false otherwise. public delegate void LogEventHandler(string message, LogLevel logLevel); public enum LogLevel { Info, Warning, Error } public interface ITimeProvider { /// /// Called when the time provider has a new time and date available. /// event TimeAvailableEventHandler TimeAvailable; /// /// Called when the time provider wishes to log a message or an error. /// event LogEventHandler Log; /// /// Begins providing time information by firing the TimeAvailable event, and log information through the Log event. /// void Start(); /// /// Stops providing time information through the TimeAvailable event, and log information through the Log event. /// void Stop(); } }