Ejemplo n.º 1
0
        private void SetParticipantVideoWindow(VideoChannel channel, VideoWindow window)
        {
            var model = ParticipantCollection.GetItem(channel);

            if (model != null && model != LocalParticipantVideoModel)
            {
                model.View = window;
                RemoteConnectParticipantVideoModel = model;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///Decline another participants request to control locally owned and shared resource.
        ///The Decline button is enabled when the _sharingModality_ActionAvailabilityChanged event handler is
        ///called with the event argument that specifies the ModalityAction.DeclineSharingControlRequest action is available.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Decline()
        {
            //_selectedContact is set to the Contact object of the participant who requested control of the resource.
            //see the _sharingModality_ControlRequestReceived method in the application sharing modality event handlers region.
            ApplicationSharingModality sharingModality = ParticipantCollection.GetItem(_resourceControllingContact.Uri).ApplicationSharingModality;

            if (sharingModality != null && sharingModality.CanInvoke(ModalityAction.DeclineSharingControlRequest))
            {
                sharingModality.BeginDeclineControlRequest((ar) => { sharingModality.EndDeclineControlRequest(ar); }, null);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///Accept another participants request to control locally owned and shared resource.
        ///The Accept button is enabled when the _sharingModality_ActionAvailabilityChanged event handler is called
        ///with the event argument that specifies the ModalityAction.AcceptSharingControlRequest action is available.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Accept()
        {
            //_selectedContact is set to the Contact object of the participant who requested control of the resource.
            //see the _sharingModality_ControlRequestReceived method in the application sharing modality event handlers region.
            ApplicationSharingModality sharingModality = ParticipantCollection.GetItem(_resourceControllingContact.Uri).ApplicationSharingModality;

            //If the requesting participant application sharing modality is available and the AcceptSharingControlRequest action can be invoked
            if (sharingModality != null && sharingModality.CanInvoke(ModalityAction.AcceptSharingControlRequest))
            {
                //Accept sharing control request.
                sharingModality.BeginAcceptControlRequest((ar) => { sharingModality.EndAcceptControlRequest(ar); }, null);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        ///Revoke control of a remotely controlled resource and locally owned shared resource.
        ///The Revoke button is enabled when the _sharingModality_ActionAvailabilityChanged event handler is called
        ///with the event argument that specifies the ModalityAction.RevokeSharingControl action is available.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Revoke()
        {
            if (_resourceControllingContact == null)
            {
                return;
            }
            ApplicationSharingModality sharingModality = ParticipantCollection.GetItem(_resourceControllingContact.Uri).ApplicationSharingModality;

            if (sharingModality != null && sharingModality.CanInvoke(ModalityAction.RevokeSharingControl))
            {
                sharingModality.BeginRevokeControl((ar) =>
                {
                    try
                    {
                        sharingModality.EndRevokeControl(ar);
                    }
                    catch (OperationException oe)
                    {
                        _log.ErrorException("Operation exception ", oe);
                    }
                }
                                                   , null);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        ///Grant another participant control of a locally owned and shared resource.
        ///The Grant button is enabled when the _sharingModality_ActionAvailabilityChanged event handler is
        ///called with the event argument that specifies the ModalityAction.GrantSharingControl action is available.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Grant()
        {
            //Get the sharing modality of the participant which the local user has selected to control the locally owned resource.
            try
            {
                ApplicationSharingModality sharingModality = (ApplicationSharingModality)ParticipantCollection.GetItem("TODO").ApplicationSharingModality;

                //If the application sharing modality is available and the resource can still be granted then grant
                //control of the resource.
                if (sharingModality != null && sharingModality.CanInvoke(ModalityAction.GrantSharingControl))
                {
                    sharingModality.BeginGrantControl((ar) => { sharingModality.EndGrantControl(ar); }
                                                      , null);
                }
            }
            catch (KeyNotFoundException keyExp)
            {
                _log.ErrorException("Chosen participant does not have an application sharing modality.", keyExp);
            }
            catch (NullReferenceException exp)
            {
                _log.ErrorException("Chosen participant does not have an application sharing modality.", exp);
            }
        }