Beispiel #1
0
        private void sayHello_Click(object sender, RoutedEventArgs e)
        {
            Demo.HelloPrx hello = createProxy();
            if (hello == null)
            {
                return;
            }

            int delay = (int)delaySlider.Value;

            try
            {
                if (!deliveryModeIsBatch())
                {
                    status.Content = "Sending request";
                    SayHelloCB cb = new SayHelloCB(this);
                    hello.begin_sayHello(delay).whenCompleted(cb.response, cb.exception).whenSent(cb.sent);
                }
                else
                {
                    flush.IsEnabled = true;
                    hello.sayHello(delay);
                    status.Content = "Queued sayHello request";
                }
            }
            catch (Ice.LocalException ex)
            {
                handleException(ex);
            }
        }
Beispiel #2
0
        private void btnHello_Click(object sender, EventArgs e)
        {
            Demo.HelloPrx hello = createProxy();
            lblStatus.Text = "Sending request";
            bool haveResponse = false;

            hello.begin_sayHello(0).whenCompleted(
                () =>
            {
                response(ref haveResponse);
            },
                (Ice.Exception ex) =>
            {
                exception(ref haveResponse, ex);
            }
                ).whenSent(
                (bool sentSynchronously) =>
            {
                sent(ref haveResponse, sentSynchronously);
            });
        }