2 using System.Collections.Generic;
5 using System.Threading.Tasks;
6 using System.Windows.Forms;
7 using SharpDisplayInterface;
8 using System.ServiceModel;
9 using System.ServiceModel.Channels;
12 namespace SharpDisplayClient
17 public partial class ClientInput : IDisplayServiceCallback, IDisposable
19 public void OnConnected()
21 //Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
22 //Trace.WriteLine("Callback thread = " + Thread.CurrentThread.ManagedThreadId);
24 MessageBox.Show("OnConnected()", "Client");
28 public void OnServerClosing()
30 //Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
31 //Trace.WriteLine("Callback thread = " + Thread.CurrentThread.ManagedThreadId);
33 //MessageBox.Show("OnServerClosing()", "Client");
34 Program.iMainForm.CloseConnection();
48 public partial class ClientOutput : DuplexClientBase<IDisplayService>, IDisplayService
50 public ClientOutput(InstanceContext callbackInstance)
51 : base(callbackInstance, new NetTcpBinding(), new EndpointAddress("net.tcp://localhost:8001/DisplayService"))
54 public void Connect(string aClientName)
56 Channel.Connect(aClientName);
59 public void SetText(int aLineIndex, string aText)
61 Channel.SetText(aLineIndex, aText);
65 public void SetTexts(System.Collections.Generic.IList<string> aTexts)
67 Channel.SetTexts(aTexts);