sl@20: using System; sl@20: using System.Collections.Generic; sl@20: using System.Linq; sl@20: using System.Text; sl@20: using System.Threading.Tasks; sl@20: using System.Windows.Forms; sl@22: using SharpDisplayInterface; sl@20: using System.ServiceModel; sl@20: using System.ServiceModel.Channels; sl@20: sl@20: sl@20: namespace SharpDisplayClient sl@20: { sl@22: public partial class ClientInput : IDisplayServiceCallback sl@20: { sl@20: public void OnConnected() sl@20: { sl@20: //Debug.Assert(Thread.CurrentThread.IsThreadPoolThread); sl@20: //Trace.WriteLine("Callback thread = " + Thread.CurrentThread.ManagedThreadId); sl@20: sl@20: MessageBox.Show("OnConnected()", "Client"); sl@20: } sl@20: sl@20: sl@20: public void OnServerClosing() sl@20: { sl@20: //Debug.Assert(Thread.CurrentThread.IsThreadPoolThread); sl@20: //Trace.WriteLine("Callback thread = " + Thread.CurrentThread.ManagedThreadId); sl@20: sl@21: //MessageBox.Show("OnServerClosing()", "Client"); sl@21: Program.iMainForm.CloseConnection(); sl@20: } sl@20: } sl@20: sl@20: sl@20: sl@20: public partial class ClientOutput : DuplexClientBase, IDisplayService sl@20: { sl@20: public ClientOutput(InstanceContext callbackInstance) sl@20: : base(callbackInstance, new NetTcpBinding(), new EndpointAddress("net.tcp://localhost:8001/DisplayService")) sl@20: { } sl@20: sl@20: public void Connect(string aClientName) sl@20: { sl@20: Channel.Connect(aClientName); sl@20: } sl@20: sl@20: public void SetText(int aLineIndex, string aText) sl@20: { sl@20: Channel.SetText(aLineIndex, aText); sl@20: } sl@20: sl@20: sl@20: public void SetTexts(System.Collections.Generic.IList aTexts) sl@20: { sl@20: Channel.SetTexts(aTexts); sl@20: } sl@20: sl@20: sl@20: } sl@20: }