Client/MainForm.cs
author sl
Tue, 12 Aug 2014 21:27:35 +0200
changeset 19 1a85ec255882
parent 18 7acec5059fa6
child 20 e3d394dd0388
permissions -rw-r--r--
Adding server method to set all texts at once.
     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 using SharpDisplayManager;
    13 
    14 namespace SharpDisplayClient
    15 {
    16     public partial class MainForm : Form
    17     {
    18         ChannelFactory<SharpDisplayManager.IDisplayService> iChannelFactory;
    19         SharpDisplayManager.IDisplayService iClient;
    20 
    21         public MainForm()
    22         {
    23             InitializeComponent();
    24         }
    25 
    26         private void buttonSetText_Click(object sender, EventArgs e)
    27         {
    28             //iClient.SetText(0,"Top");
    29             //iClient.SetText(1, "Bottom");
    30             iClient.SetTexts(new string[] { "Top", "Bottom" });
    31         }
    32 
    33         private void MainForm_Load(object sender, EventArgs e)
    34         {
    35 
    36             iChannelFactory = new ChannelFactory<SharpDisplayManager.IDisplayService>(
    37                 new NetNamedPipeBinding(),
    38                 new EndpointAddress(
    39                 "net.pipe://localhost/DisplayService"));
    40 
    41             iClient = iChannelFactory.CreateChannel();
    42         }
    43     }
    44 }