TableLayout now support row and column styles.
2 using System.Collections.Generic;
5 using System.Threading.Tasks;
6 using System.Windows.Forms;
8 using System.ServiceModel;
9 using System.ServiceModel.Channels;
12 namespace SharpDisplayClient
17 [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
18 public class Callback : ICallback, IDisposable
20 private MainForm MainForm { get; set; }
22 public Callback(MainForm aMainForm)
27 public void OnConnected()
29 //Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
30 //Trace.WriteLine("Callback thread = " + Thread.CurrentThread.ManagedThreadId);
32 MessageBox.Show("OnConnected()", "Client");
36 public void OnCloseOrder()
38 //Debug.Assert(Thread.CurrentThread.IsThreadPoolThread);
39 //Trace.WriteLine("Callback thread = " + Thread.CurrentThread.ManagedThreadId);
41 //MessageBox.Show("OnServerClosing()", "Client");
42 MainForm.CloseConnectionThreadSafe();
43 MainForm.CloseThreadSafe();
57 [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
58 public class Client : DuplexClientBase<IService>
60 public string Name { get; set; }
61 public string SessionId { get { return InnerChannel.SessionId; } }
63 public Client(ICallback aCallback)
64 : base(new InstanceContext(aCallback), new NetTcpBinding(SecurityMode.None, true), new EndpointAddress("net.tcp://localhost:8001/DisplayService"))
67 public void SetName(string aClientName)
70 Channel.SetName(aClientName);
74 public void SetLayout(TableLayout aLayout)
76 Channel.SetLayout(aLayout);
79 public void SetText(TextField aTextField)
81 Channel.SetText(aTextField);
84 public void SetTexts(System.Collections.Generic.IList<TextField> aTextFields)
86 Channel.SetTexts(aTextFields);
89 public int ClientCount()
91 return Channel.ClientCount();
96 return State == CommunicationState.Opened;