2 using System.Windows.Forms;
3 using System.Collections;
4 using System.ServiceModel;
5 using System.Collections.Generic;
7 using SharpDisplayInterface;
9 namespace SharpDisplayManager
12 /// Implement our display service.
13 /// This class is instantiated anew whenever a client send a request.
15 [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]
16 class DisplayServer : IDisplayService
18 //From IDisplayService
19 public void SetTexts(System.Collections.Generic.IList<string> aTexts)
21 //Only support two lines for now
22 for (int i=0; i<aTexts.Count; i++)
26 Program.iMainForm.marqueeLabelTop.Text = aTexts[i];
30 Program.iMainForm.marqueeLabelBottom.Text = aTexts[i];
36 public void SetText(int aLineIndex, string aText)
38 //Only support two lines for now
41 Program.iMainForm.marqueeLabelTop.Text = aText;
43 else if (aLineIndex == 1)
45 Program.iMainForm.marqueeLabelBottom.Text = aText;
50 public void Connect(string aClientName)
52 IDisplayServiceCallback callback = OperationContext.Current.GetCallbackChannel<IDisplayServiceCallback>();
53 //remove the old client if any
54 if (Program.iMainForm.iClients.Keys.Contains(aClientName))
56 Program.iMainForm.iClients.Remove(aClientName);
59 Program.iMainForm.iClients.Add(aClientName, callback);
61 //For some reason MP still hangs on that one
62 //callback.OnConnected();