using System; using Chernobyl.Event; using Chernobyl.Values; namespace Chernobyl.Readiness { /// /// An interface for working with objects that have to be "readied" or /// become available before they can be used reliably. If code queries /// information from an object that is not ready, the query may result in a /// default value being returned or an exception being thrown (it is /// recommended that implementors use the /// for this purpose). Resources that need to be loaded are examples of /// objects that need to be readied before they can be used. /// public interface IReadyable { /// /// True if this instance has been readied, false if otherwise. /// bool IsReady { get; } /// /// An event that is raised right after this /// has been readied. If an event handler is added to this event /// after it has become ready, then that event handler will be /// invoked immediately. /// event EventHandler BecameReady; } }