Exemplo n.º 1
0
        private void ShutdownPresenceView(AsyncTask task, object state)
        {
            RemotePresenceView presenceView = m_remotePresenceView;

            if (presenceView == null)
            {
                task.Complete(null);
                return;
            }
            m_remotePresenceView.PresenceNotificationReceived -= this.PresenceView_NotificationReceived;
            task.DoOneStep(
                delegate()
            {
                presenceView.BeginTerminate(
                    delegate(IAsyncResult ar)
                {
                    task.DoFinalStep(
                        delegate()
                    {
                        presenceView.EndTerminate(ar);
                    });
                },
                    null);
            });
        }
        // Callback method referred to in the call to BeginTerminate on the RemotePresenceView instance.
        private void ViewTerminateCB(IAsyncResult ar)
        {
            RemotePresenceView view = ar.AsyncState as RemotePresenceView;

            view.EndTerminate(ar);
        }