/// <summary> /// 点击选择自己填充静态实例 /// </summary> public void ConversationResourceItemPoint() { try { if (ConversationResourceItem.currentConversationResourceItem != null) { //将之前的会话卡片恢复为默认的背景色 ConversationResourceItem.currentConversationResourceItem.bor.Background = new SolidColorBrush(Colors.Transparent); } //点击选择自己填充静态实例 ConversationResourceItem.currentConversationResourceItem = this; //设置选择后的背景色 this.SetCardBackColor(); TimerJob.StartRun(new Action(() => { //资源属性刷新 //MainWindow.conversationResourceWindow.RefleshJustView(); }), 700); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 共享资源View删除 /// </summary> /// <param name="item"></param> public void ShareResourceItemRemove(ConversationResourceItem item) { try { if (this.stackPanel.Children.Contains(item)) { this.stackPanel.Children.Remove(item); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 共享资源View添加 /// </summary> /// <param name="item"></param> public void ShareResourceItemAdd(ConversationResourceItem item) { try { if (!this.stackPanel.Children.Contains(item)) { this.stackPanel.Children.Add(item); //点击进行演示 item.PreviewMouseLeftButtonDown += item_PreviewMouseLeftButtonDown; } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 资源呈现刷新 /// </summary> public void RefleshViewByMesuare() { try { //清空数据 this.stackPanel.Children.Clear(); //遍历共享资源 foreach (var item in LyncHelper.ShareableContentList) { //共享资源View子项生成 ConversationResourceItem conversationResourceItem = new ConversationResourceItem(); //设置标题 conversationResourceItem.ShareResouceItemTitle = item.Title; if (item.Presenter != null) { //获取当前演示者 conversationResourceItem.StrPresenter = Convert.ToString(item.Presenter.Contact.GetContactInformation(ContactInformationType.DisplayName)); } else { conversationResourceItem.StrPresenter = "无"; } if (item.Owner != null) { //获取当前共享资源拥有者 conversationResourceItem.StrOwner = Convert.ToString(item.Owner.GetContactInformation(ContactInformationType.DisplayName)); } //关联共享资源 conversationResourceItem.ShareableContent = item; //共享资源View添加 this.ShareResourceItemAdd(conversationResourceItem); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }