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); }
void CreateNewPipeClient() { if (pipeClient != null) { pipeClient.MessageReceived -= pipeClient_MessageReceived; pipeClient.ServerDisconnected -= pipeClient_ServerDisconnected; } pipeClient = new PipeClient(); pipeClient.MessageReceived += pipeClient_MessageReceived; pipeClient.ServerDisconnected += pipeClient_ServerDisconnected; }
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; }
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(); }
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(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { PipeClient.PipeClientDestroy(); }