private void button1_Click(object sender, EventArgs e) { localhost.HelloIndigoServiceClient proxy = new localhost.HelloIndigoServiceClient(); proxy.HelloIndigo(this.Text); Debug.Assert(Application.MessageLoop); }
static void Main(string[] args) { using (localhost.HelloIndigoServiceClient proxy = new localhost.HelloIndigoServiceClient()) { string s = proxy.HelloIndigo("hello"); Console.WriteLine(s); Console.ReadLine(); } }
private void CallService() { lock (m_proxy) { try { m_proxy.HelloIndigo(String.Format("{0} on thread {1}", this.Text, Thread.CurrentThread.ManagedThreadId)); } catch {} } }
static void Main(string[] args) { CallbackType c = new CallbackType(); InstanceContext instance = new InstanceContext(c); using (localhost.HelloIndigoServiceClient proxy = new Client.localhost.HelloIndigoServiceClient(instance)) { proxy.HelloIndigo(); Console.WriteLine("Press <ENTER> to terminate Client"); Console.ReadLine(); } }
private void button1_Click(object sender, EventArgs e) { //NOTE: anonymous method syntax //Thread t = new Thread(delegate() // { // m_proxy.HelloIndigo(String.Format("{0} on thread {1}", this.Text, Thread.CurrentThread.ManagedThreadId)); // }); //NOTE: lambda expression syntax Thread t = new Thread( () => m_proxy.HelloIndigo(String.Format("{0} on thread {1}", this.Text, Thread.CurrentThread.ManagedThreadId)) ); t.Start(); }
private void button1_Click(object sender, EventArgs e) { localhost.HelloIndigoServiceClient proxy = new localhost.HelloIndigoServiceClient(); proxy.HelloIndigo(this.Text); }