Adding server method to set all texts at once.
1.1 --- a/Client/MainForm.cs Tue Aug 12 20:55:50 2014 +0200
1.2 +++ b/Client/MainForm.cs Tue Aug 12 21:27:35 2014 +0200
1.3 @@ -25,8 +25,9 @@
1.4
1.5 private void buttonSetText_Click(object sender, EventArgs e)
1.6 {
1.7 - iClient.SetText(0,"Top");
1.8 - iClient.SetText(1, "Bottom");
1.9 + //iClient.SetText(0,"Top");
1.10 + //iClient.SetText(1, "Bottom");
1.11 + iClient.SetTexts(new string[] { "Top", "Bottom" });
1.12 }
1.13
1.14 private void MainForm_Load(object sender, EventArgs e)
2.1 --- a/Server/Servers.cs Tue Aug 12 20:55:50 2014 +0200
2.2 +++ b/Server/Servers.cs Tue Aug 12 21:27:35 2014 +0200
2.3 @@ -1,5 +1,6 @@
2.4 using System;
2.5 using System.Windows.Forms;
2.6 +using System.Collections;
2.7
2.8 namespace SharpDisplayManager
2.9 {
2.10 @@ -10,16 +11,34 @@
2.11 class DisplayServer : IDisplayService
2.12 {
2.13 //From IDisplayService
2.14 + public void SetTexts(System.Collections.Generic.IList<string> aTexts)
2.15 + {
2.16 + //Only support two lines for now
2.17 + for (int i=0; i<aTexts.Count; i++)
2.18 + {
2.19 + if (i == 0)
2.20 + {
2.21 + Program.iMainForm.marqueeLabelTop.Text = aTexts[i];
2.22 + }
2.23 + else if (i == 1)
2.24 + {
2.25 + Program.iMainForm.marqueeLabelBottom.Text = aTexts[i];
2.26 + }
2.27 + }
2.28 + }
2.29 +
2.30 + //
2.31 public void SetText(int aLineIndex, string aText)
2.32 {
2.33 - if (aLineIndex == 0)
2.34 - {
2.35 - Program.iMainForm.marqueeLabelTop.Text = aText;
2.36 - }
2.37 - else if (aLineIndex == 1)
2.38 - {
2.39 - Program.iMainForm.marqueeLabelBottom.Text = aText;
2.40 - }
2.41 + //Only support two lines for now
2.42 + if (aLineIndex == 0)
2.43 + {
2.44 + Program.iMainForm.marqueeLabelTop.Text = aText;
2.45 + }
2.46 + else if (aLineIndex == 1)
2.47 + {
2.48 + Program.iMainForm.marqueeLabelBottom.Text = aText;
2.49 + }
2.50 }
2.51
2.52 }
3.1 --- a/Server/Services.cs Tue Aug 12 20:55:50 2014 +0200
3.2 +++ b/Server/Services.cs Tue Aug 12 21:27:35 2014 +0200
3.3 @@ -1,5 +1,6 @@
3.4 using System;
3.5 using System.ServiceModel;
3.6 +using System.Collections;
3.7
3.8 namespace SharpDisplayManager
3.9 {
3.10 @@ -8,5 +9,8 @@
3.11 {
3.12 [OperationContract]
3.13 void SetText(int aLineIndex, string aText);
3.14 +
3.15 + [OperationContract]
3.16 + void SetTexts(System.Collections.Generic.IList<string> aTexts);
3.17 }
3.18 }