void _RemoteIMModality_ActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { if (e.Action == ModalityAction.SendInstantMessage && e.IsAvailable == true) { this.Dispatcher.Invoke(FormActor, new object[] { FormActions.EnableButton, Send_Button, null }); } }
/// <summary> /// Event handler for sharing modality action availability change /// This method enables or disables the modality control action buttons on the UI according to /// the availability of a given action. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void OnSharingModalityActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { try { _log.Debug("OnSharingModalityActionAvailabilityChanged"); ApplicationSharingModality thisModality = (ApplicationSharingModality)sender; Button buttonToUpdate = null; //Enable or disable a UI action button that corresponds to the action whose availability has changed. switch (e.Action) { case ModalityAction.Accept: // buttonToUpdate = AcceptSharing_Button; break; case ModalityAction.Reject: // buttonToUpdate = RejectSharing_Button; break; case ModalityAction.AcceptSharingControlRequest: // buttonToUpdate = Accept_Button; break; case ModalityAction.DeclineSharingControlRequest: // buttonToUpdate = Decline_Button; break; case ModalityAction.GrantSharingControl: // buttonToUpdate = Grant_Button; break; case ModalityAction.ReleaseSharingControl: // buttonToUpdate = Release_Button; break; case ModalityAction.RequestSharingControl: // buttonToUpdate = Request_Button; break; case ModalityAction.RevokeSharingControl: // buttonToUpdate = Revoke_Button; break; case ModalityAction.Disconnect: // buttonToUpdate = Disconnect_Button; break; } //Not all possible cases of ActionAvailability are represented in the previous switch statement. //For this reason, buttonToUpdate may be null. if (buttonToUpdate != null) { // this.Invoke(new EnableDisableButtonDelegate(EnableDisableButton), new object[] { buttonToUpdate, e.IsAvailable }); } } catch (Exception) { } }
private void OnAvModalityActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { _log.Debug("OnAvModalityActionAvailabilityChanged"); RunAtUI (() => { //each action is mapped to a button in the UI switch (e.Action) { //case ModalityAction.Connect: // buttonConnectAudio.Enabled = e.IsAvailable; // break; //case ModalityAction.Disconnect: // buttonDisconnectAudio.Enabled = e.IsAvailable; // break; //case ModalityAction.Hold: // buttonHold.Enabled = e.IsAvailable; // break; //case ModalityAction.Retrieve: // buttonRetrieve.Enabled = e.IsAvailable; // break; //case ModalityAction.LocalTransfer: // buttonTransfer.Enabled = e.IsAvailable; // break; //case ModalityAction.ConsultAndTransfer: // buttonConsultTransfer.Enabled = e.IsAvailable; // break; //case ModalityAction.Forward: // buttonForward.Enabled = e.IsAvailable; // break; //case ModalityAction.Accept: // buttonAccept.Enabled = e.IsAvailable; // break; //case ModalityAction.Reject: // buttonReject.Enabled = e.IsAvailable; // break; } } ); }
/// <summary> /// Called when the availability of an action changes. /// /// Will Enable/Disable buttons based off the availability. /// </summary> void avModality_ActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { //posts the execution into the UI thread this.BeginInvoke(new MethodInvoker(delegate() { //each action is mapped to a button in the UI switch (e.Action) { case ModalityAction.Connect: buttonConnectAudio.Enabled = e.IsAvailable; break; case ModalityAction.Disconnect: buttonDisconnectAudio.Enabled = e.IsAvailable; break; case ModalityAction.Hold: buttonHold.Enabled = e.IsAvailable; break; case ModalityAction.Retrieve: buttonRetrieve.Enabled = e.IsAvailable; break; case ModalityAction.LocalTransfer: buttonTransfer.Enabled = e.IsAvailable; break; case ModalityAction.ConsultAndTransfer: buttonConsultTransfer.Enabled = e.IsAvailable; break; case ModalityAction.Forward: buttonForward.Enabled = e.IsAvailable; break; case ModalityAction.Accept: buttonAccept.Enabled = e.IsAvailable; break; case ModalityAction.Reject: buttonReject.Enabled = e.IsAvailable; break; } })); }
void imModality_ActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { throw new NotImplementedException(); }
private void AvModalityActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { this.SetModalityStatus(e.Action.ToString()); // TODO: take some actions depending ot the modality action switch (e.Action) { case ModalityAction.Connect: break; case ModalityAction.Disconnect: break; case ModalityAction.Hold: break; case ModalityAction.Retrieve: break; case ModalityAction.LocalTransfer: break; case ModalityAction.ConsultAndTransfer: break; case ModalityAction.Forward: break; case ModalityAction.Accept: break; case ModalityAction.Reject: break; } }
private void OnParticipantActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { }
/// <summary> /// 电子白板、ppt共享【音视频、应用程序共享】 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected static void ConversationCard_ActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { try { if (MainConversationInCallBack != null) { MainConversationInCallBack(new Action <ConversationWindow>((conversationWindow) => { if (conversationWindow != null) { switch (e.Action) { case ModalityAction.Accept: Modality_Response_Accept(conversationWindow); break; case ModalityAction.Connect: //Modality_Response_Connect(conversationWindow); break; default: break; } } })); } } catch (Exception ex) { LogManage.WriteLog(typeof(LyncHelper), ex); } finally { } }
/// <summary> /// 电子白板、ppt共享【音视频、应用程序共享】 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ConversationCard_ActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { switch (e.Action) { case ModalityAction.Accept: var modalities = this.ConversationWindow.Conversation.Modalities; //视频通道 var videoChannel = ((AVModality)modalities[ModalityTypes.AudioVideo]).VideoChannel; //音频通道 var audioChannel = ((AVModality)modalities[ModalityTypes.AudioVideo]).AudioChannel; //内容共享 var shareContent = (ContentSharingModality)modalities[ModalityTypes.ContentSharing]; //程序共享 var applicationSharing = (ApplicationSharingModality)modalities[ModalityTypes.ApplicationSharing]; //视频 if (videoChannel.State == ChannelState.Notified) { this.Dispatcher.BeginInvoke(new Action(() => { try { //接受 ((AVModality)modalities[ModalityTypes.AudioVideo]).Accept(); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); }; })); } //语音 else if (audioChannel.State == ChannelState.Notified) { ((AVModality)modalities[ModalityTypes.AudioVideo]).Accept(); } //共享ppt、电子白板 else if (shareContent.State == ModalityState.Notified) { shareContent.Accept(); } //共享应用程序 else if (applicationSharing.State == ModalityState.Notified) { applicationSharing.Accept(); } break; case ModalityAction.ConsultAndTransfer: this.Dispatcher.BeginInvoke(new Action(() => { //if (MainWindow.conversationM != null && ConversationCard.conversationCard != null) //{ // //隐藏左侧两列 // MainWindow.conversationM.PanelVisibilityChangedToMax(ConversationCard.conversationCard); //} })); break; default: break; } }
/// <summary> /// 电子白板、ppt共享【音视频、应用程序共享】 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected static void ConversationCard_ActionAvailabilityChanged(object sender, ModalityActionAvailabilityChangedEventArgs e) { try { if (MainConversationInCallBack != null) { MainConversationInCallBack(new Action <ConversationWindow>((conversationWindow) => { if (conversationWindow != null) { switch (e.Action) { case ModalityAction.Accept: var modalities = conversationWindow.Conversation.Modalities; //视频通道 VideoChannel videoChannel = ((AVModality)modalities[ModalityTypes.AudioVideo]).VideoChannel; //音频通道 AudioChannel audioChannel = ((AVModality)modalities[ModalityTypes.AudioVideo]).AudioChannel; //内容共享 ContentSharingModality shareContent = (ContentSharingModality)modalities[ModalityTypes.ContentSharing]; //程序共享 ApplicationSharingModality applicationSharing = (ApplicationSharingModality)modalities[ModalityTypes.ApplicationSharing]; //视频 if (videoChannel != null && videoChannel.State == ChannelState.Notified) { App.Current.Dispatcher.BeginInvoke(new Action(() => { try { //接受 ((AVModality)modalities[ModalityTypes.AudioVideo]).Accept(); } catch (Exception ex) { LogManage.WriteLog(typeof(LyncHelper), ex); }; })); } //语音 else if (audioChannel != null && audioChannel.State == ChannelState.Notified) { ((AVModality)modalities[ModalityTypes.AudioVideo]).Accept(); } //共享ppt、电子白板 else if (shareContent != null && shareContent.State == ModalityState.Notified) { shareContent.Accept(); } //共享应用程序 else if (applicationSharing != null && applicationSharing.State == ModalityState.Notified) { applicationSharing.Accept(); } break; default: break; } } })); } } catch (Exception ex) { LogManage.WriteLog(typeof(LyncHelper), ex); } finally { } }