private void btnShutdown_Click(object sender, EventArgs e) { Demo.HelloPrx hello = createProxy(); lblStatus.Text = "Shutting down server"; bool haveResponse = false; hello.begin_shutdown().whenCompleted( () => { response(ref haveResponse); }, (Ice.Exception ex) => { exception(ref haveResponse, ex); } ).whenSent( (bool sentSynchronously) => { sent(ref haveResponse, sentSynchronously); }); }
private void shutdown_Click(object sender, RoutedEventArgs e) { Demo.HelloPrx hello = createProxy(); if (hello == null) { return; } int delay = (int)delaySlider.Value; try { if (!deliveryModeIsBatch()) { AsyncResult <Demo.Callback_Hello_shutdown> result = hello.begin_shutdown(); status.Content = "Sending request"; result.whenCompleted(delegate() { status.Content = "Ready"; }, delegate(Exception ex) { handleException(ex); }); } else { flush.IsEnabled = true; hello.shutdown(); status.Content = "Queued shutdown request"; } } catch (Ice.LocalException ex) { handleException(ex); } }