private void btnEcho_Click(object sender, EventArgs e) { DemoServiceClient.DemoServiceClient dsc; DemoServiceSesAClient.DemoSvcSesAClient dssc; DemoServiceSesNAClient.DemoSvcSesNAClient dssnac; switch (cBoxClientList.SelectedItem.ToString()) { case "DemoServiceClient": dsc = new DemoServiceClient.DemoServiceClient(); tbEcho.Text += dsc.Echo(tbEcho.Text); dsc.Close(); break; case "DemoServiceSesAClient": dssc = new DemoServiceSesAClient.DemoSvcSesAClient(); tbEcho.Text += dssc.Echo(tbEcho.Text); dssc.Close(); break; case "DemoServiceSesNAClient": dssnac = new DemoServiceSesNAClient.DemoSvcSesNAClient(); tbEcho.Text += dssnac.Echo(tbEcho.Text); dssnac.Close(); break; default: MessageBox.Show("No Client!"); break; } }
private void btnGetCounter_Click(object sender, EventArgs e) { DemoServiceSesAClient.DemoSvcSesAClient dssc; DemoServiceSesNAClient.DemoSvcSesNAClient dssnac; switch (cBoxClientList.SelectedItem.ToString()) { case "DemoServiceClient": MessageBox.Show("Not implemented in DemoServiceClient!"); break; case "DemoServiceSesAClient": dssc = new DemoServiceSesAClient.DemoSvcSesAClient(); tbGetCounter.Text = dssc.GetCounter().ToString(); dssc.Close(); break; case "DemoServiceSesNAClient": dssnac = new DemoServiceSesNAClient.DemoSvcSesNAClient(); tbGetCounter.Text = dssnac.GetCounter().ToString(); dssnac.Close(); break; default: MessageBox.Show("No Client!"); break; } }