using System; namespace SimConnect { /// /// Called when new data arrives from the SimConnect server. /// /// An instance of the data class as passed to AddDefinition containing the variable values /// The data class as passed to AddDefinition public delegate void SimConnectDataHandlerAction(T data) where T : class; /// /// Gets notified of changes to the SimConnect state. /// public interface ISimConnectClientObserver { /// /// Gets called when the SimConnect connection is lost. The client will not receive further notifications, /// a new connection should be attempted if desired. /// void OnQuit(); } /// /// Provides access to the SimConnect library. /// public interface ISimConnectClient : IDisposable { /// /// Attaches the specified observer to receive status notifications. /// /// The observer to receive status notifications void AttachObserver(ISimConnectClientObserver observer); /// /// Registers a definition to receive updates from the SimConnect server. /// /// A callback method which is called whenever a data update is received /// A class defining the variables to monitor annotated using the SimConnectVariable attribute /// An IDisposable which can be disposed to unregister the definition. Dispose is not required to be called when the client is disconnected, but will not throw an exception. IDisposable AddDefinition(SimConnectDataHandlerAction onData) where T : class; } }