1.1 --- a/Interface/Interface.cs Wed Oct 22 12:17:52 2014 +0200
1.2 +++ b/Interface/Interface.cs Sat Oct 25 13:35:11 2014 +0200
1.3 @@ -66,8 +66,39 @@
1.4 Index = 0;
1.5 ColumnSpan = 1;
1.6 RowSpan = 1;
1.7 + //Text
1.8 + Text = "";
1.9 + Alignment = ContentAlignment.MiddleLeft;
1.10 + //Bitmap
1.11 + Bitmap = null;
1.12 }
1.13
1.14 + //Text constructor
1.15 + public DataField(int aIndex, string aText = "", ContentAlignment aAlignment = ContentAlignment.MiddleLeft)
1.16 + {
1.17 + ColumnSpan = 1;
1.18 + RowSpan = 1;
1.19 + Index = aIndex;
1.20 + Text = aText;
1.21 + Alignment = aAlignment;
1.22 + //
1.23 + Bitmap = null;
1.24 + }
1.25 +
1.26 + //Bitmap constructor
1.27 + public DataField(int aIndex, Bitmap aBitmap)
1.28 + {
1.29 + ColumnSpan = 1;
1.30 + RowSpan = 1;
1.31 + Index = aIndex;
1.32 + Bitmap = aBitmap;
1.33 + //Text
1.34 + Text = "";
1.35 + Alignment = ContentAlignment.MiddleLeft;
1.36 + }
1.37 +
1.38 +
1.39 + //Generic layout properties
1.40 [DataMember]
1.41 public int Index { get; set; }
1.42
1.43 @@ -82,55 +113,21 @@
1.44
1.45 [DataMember]
1.46 public int RowSpan { get; set; }
1.47 -
1.48 - }
1.49 -
1.50 -
1.51 - /// <summary>
1.52 - /// TextField can be send to our server to be displayed on the screen.
1.53 - /// </summary>
1.54 - [DataContract]
1.55 - public class TextField : DataField
1.56 - {
1.57 - public TextField()
1.58 - {
1.59 - Index = 0;
1.60 - Text = "";
1.61 - Alignment = ContentAlignment.MiddleLeft;
1.62 - }
1.63 -
1.64 - public TextField(int aIndex, string aText = "", ContentAlignment aAlignment = ContentAlignment.MiddleLeft)
1.65 - {
1.66 - Index = aIndex;
1.67 - Text = aText;
1.68 - Alignment = aAlignment;
1.69 - }
1.70 -
1.71 +
1.72 + //Text properties
1.73 [DataMember]
1.74 public string Text { get; set; }
1.75
1.76 [DataMember]
1.77 public ContentAlignment Alignment { get; set; }
1.78 - }
1.79
1.80 - /// <summary>
1.81 - /// TextField can be send to our server to be displayed on the screen.
1.82 - /// </summary>
1.83 - [DataContract]
1.84 - public class BitmapField : DataField
1.85 - {
1.86 - public BitmapField()
1.87 - {
1.88 - }
1.89 -
1.90 - public BitmapField(int aIndex, Bitmap aBitmap)
1.91 - {
1.92 - Index = aIndex;
1.93 - Bitmap = aBitmap;
1.94 - }
1.95 -
1.96 + //Bitmap properties
1.97 [DataMember]
1.98 public Bitmap Bitmap { get; set; }
1.99 +
1.100 + //
1.101 + public bool HasBitmap { get{ return Bitmap!=null;} }
1.102 +
1.103 }
1.104
1.105 /// <summary>
1.106 @@ -164,14 +161,14 @@
1.107 /// </summary>
1.108 /// <param name="aTextFieldIndex"></param>
1.109 [OperationContract(IsOneWay = true)]
1.110 - void SetText(TextField aTextField);
1.111 + void SetText(DataField aField);
1.112
1.113 /// <summary>
1.114 /// Allows a client to set multiple text fields at once.
1.115 /// </summary>
1.116 /// <param name="aTexts"></param>
1.117 [OperationContract(IsOneWay = true)]
1.118 - void SetTexts(System.Collections.Generic.IList<TextField> aTextFields);
1.119 + void SetTexts(System.Collections.Generic.IList<DataField> aFields);
1.120
1.121 /// <summary>
1.122 /// Put the given bitmap in the given field on your display.
1.123 @@ -179,7 +176,7 @@
1.124 /// </summary>
1.125 /// <param name="aBitmapField"></param>
1.126 [OperationContract(IsOneWay = true)]
1.127 - void SetBitmap(BitmapField aBitmapField);
1.128 + void SetBitmap(DataField aBitmapField);
1.129
1.130 /// <summary>
1.131 /// Provides the number of clients currently connected