using System;
using Wayne.Lib;
namespace Wayne.ForecourtControl.OptBridge
{
///
/// Root object for the Opt communication using a application-layer bridge. The interface provides functionality to
/// get access to single Opts, and change the configuration.
///
public interface IOptBridge : IConnectable, IIdentifiableEntity, IDisposable
{
#region Properties
///
/// Collection of the currently configured Opts.
///
System.Collections.ObjectModel.ReadOnlyCollection Opts { get;}
///
/// The Client id that was specified in the connection string when connecting.
///
int ClientId { get;}
///
/// The Client name that was specified in the connection string when connecting.
///
string ClientName { get;}
#endregion
#region Events
///
/// Event that notifies clients that a Opt has been added or removed.
///
event EventHandler OnConfigurationChanged;
#endregion
#region Methods
///
/// Configure that the specified opt should be handled and polled. If the request completes sucessfully, the new
/// Opt is added to the Opts collection.
///
///
///
///
void AddOptAsync(int optId, EventHandler requestCompleted, object userToken);
///
/// Remove the specified opt from the list of connected opts. If the request completes successfully, the
/// Opts collection is modified.
///
///
///
///
void RemoveOptAsync(int optId, EventHandler requestCompleted, object userToken);
#endregion
}
}