Client/MainForm.cs
author sl
Thu, 14 Aug 2014 09:12:18 +0200
changeset 23 bb8b0b9fa21b
parent 20 e3d394dd0388
child 25 6f10207a89a8
permissions -rw-r--r--
Removing older solution file.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Linq;
     7 using System.Text;
     8 using System.Threading.Tasks;
     9 using System.Windows.Forms;
    10 using System.ServiceModel;
    11 using System.ServiceModel.Channels;
    12 
    13 
    14 namespace SharpDisplayClient
    15 {
    16     public partial class MainForm : Form
    17     {
    18         ClientOutput iClientOutput;
    19         InstanceContext iInstanceContext;
    20         ClientInput iClientInput;
    21 
    22         public MainForm()
    23         {
    24             InitializeComponent();
    25         }
    26 
    27         private void buttonSetText_Click(object sender, EventArgs e)
    28         {
    29             //iClient.SetText(0,"Top");
    30             //iClient.SetText(1, "Bottom");
    31             iClientOutput.SetTexts(new string[] { "Top", "Bottom" });
    32         }
    33 
    34         private void MainForm_Load(object sender, EventArgs e)
    35         {
    36             iClientInput = new ClientInput();
    37             iInstanceContext = new InstanceContext(iClientInput);
    38             iClientOutput = new ClientOutput(iInstanceContext);
    39 
    40             iClientOutput.Connect("TestClient");
    41 
    42         }
    43 
    44         public void CloseConnection()
    45         {
    46             //If we close the instance context after the client output it hangs
    47             iInstanceContext.Close();
    48             iInstanceContext = null;
    49             iClientOutput.Close();
    50             iClientOutput = null;
    51             iClientInput = null;
    52         }
    53     }
    54 }