Documentation and minor clean-up.
authorStephaneLenclud
Tue, 26 May 2015 12:23:55 +0200
changeset 138426cc984fd18
parent 136 8badd89fb78c
child 139 9e88c1a8cc1d
Documentation and minor clean-up.
Client/Client.cs
Interface/Interface.cs
Server/MainForm.Hid.cs
     1.1 --- a/Client/Client.cs	Wed May 06 22:07:32 2015 +0200
     1.2 +++ b/Client/Client.cs	Tue May 26 12:23:55 2015 +0200
     1.3 @@ -31,7 +31,7 @@
     1.4  namespace SharpDisplayClient
     1.5  {
     1.6      /// <summary>
     1.7 -    ///
     1.8 +    /// Client side Sharp Display callback implementation.
     1.9      /// </summary>
    1.10      [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
    1.11      public class Callback : ICallback, IDisposable
    1.12 @@ -43,6 +43,9 @@
    1.13              MainForm = aMainForm;
    1.14          }
    1.15  
    1.16 +        /// <summary>
    1.17 +        /// Not used I believe.
    1.18 +        /// </summary>
    1.19          public void OnConnected()
    1.20          {
    1.21              //Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
    1.22 @@ -71,7 +74,7 @@
    1.23  
    1.24  
    1.25      /// <summary>
    1.26 -    ///
    1.27 +    /// Client side implementation of our Sharp Display Service.
    1.28      /// </summary>
    1.29      [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
    1.30      public class Client : DuplexClientBase<IService>
    1.31 @@ -200,6 +203,12 @@
    1.32              }
    1.33          }
    1.34  
    1.35 +        /// <summary>
    1.36 +        /// Set our client's name.
    1.37 +        /// Client's name is typically user friendly.
    1.38 +        /// It does not have to be unique.
    1.39 +        /// </summary>
    1.40 +        /// <param name="aClientName">Our client name.</param>
    1.41          public void SetName(string aClientName)
    1.42          {
    1.43              Name = aClientName;
    1.44 @@ -207,7 +216,10 @@
    1.45              iClient.SetName(aClientName);
    1.46          }
    1.47  
    1.48 -
    1.49 +        /// <summary>
    1.50 +        /// Set your client fields' layout.
    1.51 +        /// </summary>
    1.52 +        /// <param name="aLayout">The layout to apply for this client.</param>
    1.53          public void SetLayout(TableLayout aLayout)
    1.54          {
    1.55              Layout = aLayout;
    1.56 @@ -238,7 +250,7 @@
    1.57  
    1.58              if (!fieldFound)
    1.59              {
    1.60 -                //Field not found, make to use SetFields with all your fields at least once after setting your layout.
    1.61 +                //Field not found, make sure to use CreateFields first after setting your layout.
    1.62                  return false;
    1.63              }
    1.64  
    1.65 @@ -274,7 +286,7 @@
    1.66              //
    1.67              if (fieldFoundCount!=aFields.Count)
    1.68              {
    1.69 -                //Field not found, make sure to use SetFields with all your fields at least once after setting your layout.
    1.70 +                //Field not found, make sure to use CreateFields first after setting your layout.
    1.71                  return false;
    1.72              }
    1.73  
    1.74 @@ -285,6 +297,7 @@
    1.75  
    1.76          /// <summary>
    1.77          /// Use this function when creating your fields.
    1.78 +        /// This must be done at least once after setting your layout.
    1.79          /// </summary>
    1.80          /// <param name="aFields"></param>
    1.81          public void CreateFields(System.Collections.Generic.IList<DataField> aFields)
    1.82 @@ -294,6 +307,10 @@
    1.83              iClient.SetFields(aFields);
    1.84          }
    1.85  
    1.86 +        /// <summary>
    1.87 +        /// Provide the number of clients currently connected to our server.
    1.88 +        /// </summary>
    1.89 +        /// <returns>Number of clients currently connected to our server.</returns>
    1.90          public int ClientCount()
    1.91          {
    1.92              CheckConnection();
     2.1 --- a/Interface/Interface.cs	Wed May 06 22:07:32 2015 +0200
     2.2 +++ b/Interface/Interface.cs	Tue May 26 12:23:55 2015 +0200
     2.3 @@ -18,6 +18,7 @@
     2.4  {
     2.5      /// <summary>
     2.6      /// For client to specify a specific layout.
     2.7 +    /// A table layout is sent from client to server and defines data fields layout on our display.
     2.8      /// </summary>
     2.9      [DataContract]
    2.10      public class TableLayout
    2.11 @@ -26,9 +27,13 @@
    2.12          {
    2.13              Columns = new List<ColumnStyle>();
    2.14              Rows = new List<RowStyle>();
    2.15 -            Cells = new List<DataField>();
    2.16          }
    2.17  
    2.18 +        /// <summary>
    2.19 +        /// Construct our table layout.
    2.20 +        /// </summary>
    2.21 +        /// <param name="aColumnCount">Number of column in our table.</param>
    2.22 +        /// <param name="aRowCount">Number of rows in our table.</param>
    2.23          public TableLayout(int aColumnCount, int aRowCount)
    2.24          {
    2.25              Columns = new List<ColumnStyle>();
    2.26 @@ -46,9 +51,6 @@
    2.27          }
    2.28  
    2.29          [DataMember]
    2.30 -        public List<DataField> Cells { get; set; }
    2.31 -
    2.32 -        [DataMember]
    2.33          public List<ColumnStyle> Columns { get; set; }
    2.34  
    2.35          [DataMember]
    2.36 @@ -56,7 +58,8 @@
    2.37      }
    2.38  
    2.39      /// <summary>
    2.40 -    ///
    2.41 +    /// Define a data field on our display.
    2.42 +    /// Data field can be either text or bitmap.
    2.43      /// </summary>
    2.44      [DataContract]
    2.45      public class DataField
     3.1 --- a/Server/MainForm.Hid.cs	Wed May 06 22:07:32 2015 +0200
     3.2 +++ b/Server/MainForm.Hid.cs	Tue May 26 12:23:55 2015 +0200
     3.3 @@ -13,6 +13,9 @@
     3.4  
     3.5  namespace SharpDisplayManager
     3.6  {
     3.7 +    /// <summary>
     3.8 +    /// Implement handling of HID input reports notably to be able to launch an application using the Green Start button from IR remotes.
     3.9 +    /// </summary>
    3.10      [System.ComponentModel.DesignerCategory("Code")]
    3.11      public class MainFormHid : Form
    3.12      {