sl@24: using System;
sl@24: using System.Collections.Generic;
sl@24: using System.Linq;
sl@24: using System.Text;
sl@24: using System.Threading.Tasks;
sl@24: using System.ServiceModel;
sl@24: using System.Collections;
sl@24:
sl@24:
sl@24: namespace SharpDisplayInterface
sl@24: {
sl@30:
sl@30: [ServiceContract( CallbackContract = typeof(IDisplayServiceCallback),
sl@30: SessionMode = SessionMode.Required)]
sl@24: public interface IDisplayService
sl@24: {
sl@32: ///
sl@32: /// Set the name of this client.
sl@32: /// Name is a convenient way to recognize your client.
sl@32: /// Naming you client is not mandatory.
sl@32: /// In the absence of a name the session ID is often used instead.
sl@32: ///
sl@32: ///
sl@24: [OperationContract(IsOneWay = true)]
sl@32: void SetName(string aClientName);
sl@24:
sl@32: ///
sl@32: /// Put the given text in the given field on your display.
sl@32: /// Fields are often just lines of text.
sl@32: ///
sl@32: ///
sl@32: ///
sl@24: [OperationContract(IsOneWay = true)]
sl@32: void SetText(int aFieldIndex, string aText);
sl@26:
sl@32: ///
sl@32: /// Allows a client to set multiple text fields at once.
sl@32: /// First text in the list is set into field index 0.
sl@32: /// Last text in the list is set into field index N-1.
sl@32: ///
sl@32: ///
sl@24: [OperationContract(IsOneWay = true)]
sl@24: void SetTexts(System.Collections.Generic.IList aTexts);
sl@32:
sl@32: ///
sl@32: /// Provides the number of clients currently connected
sl@32: ///
sl@32: ///
sl@32: [OperationContract()]
sl@32: int ClientCount();
sl@32:
sl@24: }
sl@24:
sl@24:
sl@24: public interface IDisplayServiceCallback
sl@24: {
sl@24: [OperationContract(IsOneWay = true)]
sl@24: void OnConnected();
sl@24:
sl@32: ///
sl@32: /// Tell our client to close its connection.
sl@32: /// Notably sent when the server is shutting down.
sl@32: ///
sl@24: [OperationContract(IsOneWay = true)]
sl@32: void OnCloseOrder();
sl@24: }
sl@24:
sl@24:
sl@24:
sl@24: }