/// <summary> /// 点击选择自己填充静态实例 /// </summary> public void ConversationCardFill() { try { if (ConversationCard.currentConversationCard != null) { //将之前的会话卡片恢复为默认的背景色 ConversationCard.currentConversationCard.bor.Background = new SolidColorBrush(Colors.Transparent); //将之前的会话卡片恢复为默认的背景色 ConversationCard.currentConversationCard.bor2.Background = new SolidColorBrush(Colors.Transparent); } //点击选择自己填充静态实例 ConversationCard.currentConversationCard = this; //将选择的会话卡片设置新的背景 this.bor2.Background = this.bor.Background = new SolidColorBrush(Colors.SkyBlue) { Opacity = 0.3 }; //foreach (var item in ConversationM.ConversationManageWindow.DicCardAndConversationWidow.Keys) //{ // if (item.Equals(this.ConversationWindow)) // { // //Win32API.ShowWindow(item.Handle, Win32API.SW_SHOW); // //获取会话窗体的状态 // Win32API.GetWindowPlacement(item.Handle, ref this.Placement); // //最小话窗体 // this.Placement.showCmd = 1; // Win32API.SetWindowPlacement(item.Handle, ref this.Placement); // } // else // { // Win32API.ShowWindow(item.Handle, Win32API.SW_HIDE); // } //} //if (this.ConversationWindow != null) //{ // //获取会话窗体的状态 // Win32API.SetForegroundWindow(this.ConversationWindow.Handle); //} //恢复默认会话全屏样式 //MainWindow.mainWindow.RefleshTheConversationFullScreenStyle(); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 添加会话卡片 /// </summary> public void ConversationCardItemAdd(ConversationCard conversationCard) { try { //添加会话卡片 if (!stackPanel2.Children.Contains(conversationCard)) { this.stackPanel2.Children.Add(conversationCard); } //会话卡片对应会话窗体的字典集合添加子项 this.DicCardAndConversationWidow.Add(conversationCard.ConversationWindow, conversationCard); } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }
/// <summary> /// 删除会话卡片 /// </summary> /// <param name="conversationCard"></param> public void ConversationCardItemRemove(ConversationCard conversationCard) { try { //删除会话卡片 if (stackPanel2.Children.Contains(conversationCard)) { this.stackPanel2.Children.Remove(conversationCard); } //会话卡片对应会话窗体的字典集合删除子项 if (this.DicCardAndConversationWidow.ContainsKey(conversationCard.ConversationWindow)) { this.DicCardAndConversationWidow.Remove(conversationCard.ConversationWindow); } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } }