Interface/Interface.cs
author StephaneLenclud
Mon, 18 Aug 2014 23:43:44 +0200
changeset 35 f3893924a6eb
parent 30 c375286d1a1c
child 43 86aad774b532
permissions -rw-r--r--
Tried using Control instead of Label as base class for our Marquee.
Sticking to Label for now.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 using System.ServiceModel;
     7 using System.Collections;
     8 
     9 
    10 namespace SharpDisplayInterface
    11 {
    12     
    13     [ServiceContract(   CallbackContract = typeof(IDisplayServiceCallback),
    14                         SessionMode = SessionMode.Required)]
    15     public interface IDisplayService
    16     {
    17         /// <summary>
    18         /// Set the name of this client.
    19         /// Name is a convenient way to recognize your client.
    20         /// Naming you client is not mandatory.
    21         /// In the absence of a name the session ID is often used instead.
    22         /// </summary>
    23         /// <param name="aClientName"></param>
    24         [OperationContract(IsOneWay = true)]
    25         void SetName(string aClientName);
    26 
    27         /// <summary>
    28         /// Put the given text in the given field on your display.
    29         /// Fields are often just lines of text.
    30         /// </summary>
    31         /// <param name="aFieldIndex"></param>
    32         /// <param name="aText"></param>
    33         [OperationContract(IsOneWay = true)]
    34         void SetText(int aFieldIndex, string aText);
    35 
    36         /// <summary>
    37         /// Allows a client to set multiple text fields at once.
    38         /// First text in the list is set into field index 0.
    39         /// Last text in the list is set into field index N-1.
    40         /// </summary>
    41         /// <param name="aTexts"></param>
    42         [OperationContract(IsOneWay = true)]
    43         void SetTexts(System.Collections.Generic.IList<string> aTexts);
    44 
    45         /// <summary>
    46         /// Provides the number of clients currently connected
    47         /// </summary>
    48         /// <returns></returns>
    49         [OperationContract()]
    50         int ClientCount();
    51 
    52     }
    53 
    54 
    55     public interface IDisplayServiceCallback
    56     {
    57         [OperationContract(IsOneWay = true)]
    58         void OnConnected();
    59 
    60         /// <summary>
    61         /// Tell our client to close its connection.
    62         /// Notably sent when the server is shutting down.
    63         /// </summary>
    64         [OperationContract(IsOneWay = true)]
    65         void OnCloseOrder();
    66     }
    67 
    68 
    69 
    70 }