sl@18: using System; sl@18: using System.Collections.Generic; sl@18: using System.ComponentModel; sl@18: using System.Data; sl@18: using System.Drawing; sl@18: using System.Linq; sl@18: using System.Text; sl@18: using System.Threading.Tasks; sl@18: using System.Windows.Forms; sl@18: using System.ServiceModel; sl@18: using System.ServiceModel.Channels; sl@20: sl@18: sl@18: namespace SharpDisplayClient sl@18: { sl@18: public partial class MainForm : Form sl@18: { sl@20: ClientOutput iClientOutput; sl@21: InstanceContext iInstanceContext; sl@20: ClientInput iClientInput; sl@18: sl@18: public MainForm() sl@18: { sl@18: InitializeComponent(); sl@18: } sl@18: sl@18: private void buttonSetText_Click(object sender, EventArgs e) sl@18: { sl@19: //iClient.SetText(0,"Top"); sl@19: //iClient.SetText(1, "Bottom"); sl@20: iClientOutput.SetTexts(new string[] { "Top", "Bottom" }); sl@18: } sl@18: sl@18: private void MainForm_Load(object sender, EventArgs e) sl@18: { sl@20: iClientInput = new ClientInput(); sl@21: iInstanceContext = new InstanceContext(iClientInput); sl@21: iClientOutput = new ClientOutput(iInstanceContext); sl@18: sl@20: iClientOutput.Connect("TestClient"); sl@18: sl@18: } sl@21: sl@21: public void CloseConnection() sl@21: { sl@21: //If we close the instance context after the client output it hangs sl@21: iInstanceContext.Close(); sl@21: iInstanceContext = null; sl@21: iClientOutput.Close(); sl@21: iClientOutput = null; sl@21: iClientInput = null; sl@21: } sl@18: } sl@18: }