Ejemplo n.º 1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     SetButtons();
     PipeClient.PipeClientInitialize();
     // Register our method delegates as callbacks
     PipeClient.RegisterOnDisconnectCallback(OnDisconnect);
     PipeClient.RegisterOnErrorCallback(OnError);
     PipeClient.RegisterOnMessageCallback(OnMessage);
     PipeClient.RegisterOnSentCallback(OnSent);
 }
Ejemplo n.º 2
0
        void CreateNewPipeClient()
        {
            if (pipeClient != null)
            {
                pipeClient.MessageReceived    -= pipeClient_MessageReceived;
                pipeClient.ServerDisconnected -= pipeClient_ServerDisconnected;
            }

            pipeClient = new PipeClient();
            pipeClient.MessageReceived    += pipeClient_MessageReceived;
            pipeClient.ServerDisconnected += pipeClient_ServerDisconnected;
        }
Ejemplo n.º 3
0
        private void Button2_Click(object sender, EventArgs e)
        {
            if (PipeClient.PipeClientSend(textBox1.Text))
            {
                textBox2.AppendText(string.Format("<< Successfully sent message: {0}", textBox1.Text) + PipeUtils.sLineBreak);
            }
            else
            {
                textBox2.AppendText(string.Format("<< Failed to send message: {0}", textBox1.Text) + PipeUtils.sLineBreak);
            }

            textBox1.Text = string.Empty;
        }
Ejemplo n.º 4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            connected = PipeClient.PipeClientConnect();

            if (connected)
            {
                textBox2.AppendText("<< Connected to pipe server." + PipeUtils.sLineBreak);
            }
            else
            {
                textBox2.AppendText("<< Failed to connected to pipe server." + PipeUtils.sLineBreak);
            }

            SetButtons();
        }
Ejemplo n.º 5
0
        public static void Main(string[] args)
        {
            var pipeClient = new PipeClient <IMyService>();
            var proxy      = pipeClient.GetProxy();

            string data = proxy.GetData(3); //returns "You entered: 3"

            Console.WriteLine(data);

            CompositeType composite = proxy.GetDataUsingDataContract(new CompositeType()); //composite.StringValue will be "Hello Suffix"

            Console.WriteLine(composite.StringValue);

            Console.ReadLine();
        }
Ejemplo n.º 6
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     PipeClient.PipeClientDestroy();
 }