public void UPloadMeetAddressAndCancelLock(bool successed) { try { #region 获取会议地址并上传到服务器 //只有会话初始化完毕才有的结果 DispatcherTimer lynTimer = null; TimerJob.StartRun(new Action(() => { if (LyncHelper.MainConversation != null && LyncHelper.MainConversation.Conversation.Properties.ContainsKey(ConversationProperty.ConferenceAccessInformation)) { ConferenceAccessInformation conferenceAccessInformation = (ConferenceAccessInformation)LyncHelper.MainConversation.Conversation.Properties[ConversationProperty.ConferenceAccessInformation]; if (!string.IsNullOrEmpty(conferenceAccessInformation.InternalUrl)) { //开启会话 ModelManage.ConferenceLyncConversation.FillConversation(Constant.ConferenceName, conferenceAccessInformation.InternalUrl, new Action <bool>((issuccessed) => { if (successed) { #region 允许其他成员进行会议查询并进行初始化 ModelManage.ConferenceLyncConversation.AllowConversationInit(Constant.ConferenceName, new Action <bool>((flg) => { })); #endregion } })); #region 释放dns(改为自由获取),主窗体状态还原(非置顶) TimerJob.StartRun(new Action(() => { //设置DNS NetWorkAdapter.SetNetworkAdapter(Constant.RouteIp); //取消置顶 MainWindow.mainWindow.Topmost = false; })); #endregion lynTimer.Stop(); } } }), 500, out lynTimer); #endregion } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }
/// <summary> /// 获取会议地址 /// </summary> public static string GetConversation_Address() { string address = null; try { if (LyncHelper.MainConversation != null && LyncHelper.MainConversation.Conversation.Properties.ContainsKey(ConversationProperty.ConferenceAccessInformation)) { ConferenceAccessInformation conferenceAccessInformation = (ConferenceAccessInformation)LyncHelper.MainConversation.Conversation.Properties[ConversationProperty.ConferenceAccessInformation]; if (!string.IsNullOrEmpty(conferenceAccessInformation.InternalUrl)) { address = conferenceAccessInformation.InternalUrl; } } } catch (Exception ex) { LogManage.WriteLog(typeof(LyncHelper), ex); } finally { } return(address); }
/// <summary> /// Returns the meet-now meeting access key as a string /// </summary> /// <returns></returns> private string CreateConferenceKey() { string returnValue = string.Empty; try { StringBuilder MeetingKey = new StringBuilder(); //These properties are used to invite people by creating an email (or text message, or IM) //and adding the dial in number, external Url, internal Url, and conference Id ConferenceAccessInformation conferenceAccess = (ConferenceAccessInformation)_Conversation.Properties[ConversationProperty.ConferenceAccessInformation]; if (conferenceAccess.Id.Length > 0) { MeetingKey.Append("Meeting Id: " + conferenceAccess.Id); MeetingKey.Append(System.Environment.NewLine); } if (conferenceAccess.AdmissionKey.Length > 0) { MeetingKey.Append(conferenceAccess.AdmissionKey); MeetingKey.Append(System.Environment.NewLine); } string[] attendantNumbers = (string[])conferenceAccess.AutoAttendantNumbers; StringBuilder sb2 = new StringBuilder(); sb2.Append(System.Environment.NewLine); foreach (string aNumber in attendantNumbers) { sb2.Append("\t\t" + aNumber); sb2.Append(System.Environment.NewLine); } if (sb2.ToString().Trim().Length > 0) { MeetingKey.Append("Auto attendant numbers:" + sb2.ToString()); MeetingKey.Append(System.Environment.NewLine); } if (conferenceAccess.ExternalUrl.Length > 0) { MeetingKey.Append("External Url: " + conferenceAccess.ExternalUrl); MeetingKey.Append(System.Environment.NewLine); } if (conferenceAccess.InternalUrl.Length > 0) { MeetingKey.Append("Inner Url: " + conferenceAccess.InternalUrl); MeetingKey.Append(System.Environment.NewLine); } MeetingKey.Append("Meeting access type: " + ((ConferenceAccessType)_Conversation.Properties[ConversationProperty.ConferencingAccessType]).ToString()); MeetingKey.Append(System.Environment.NewLine); returnValue = MeetingKey.ToString(); } catch (System.NullReferenceException nr) { System.Diagnostics.Debug.WriteLine("Null ref Eception on ConferenceAccessInformation changed " + nr.Message); } catch (LyncClientException lce) { System.Diagnostics.Debug.WriteLine("Exception on ConferenceAccessInformation changed " + lce.Message); } return(returnValue); }