/// <summary> /// 执行群组成员管理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CommunitymemberMgr_Executed(object sender, ExecutedRoutedEventArgs e) { DependencyObject originalSource = e.OriginalSource as DependencyObject; if (originalSource != null) { ListBox ancestorByType = VisualTree.GetAncestorByType(originalSource, typeof(ListBox)) as ListBox; ListBoxItem container = VisualTree.GetAncestorByType(originalSource, typeof(ListBoxItem)) as ListBoxItem; if ((ancestorByType != null) && (container != null)) { InstanceAnswerPro.Core.Community.Community community = ancestorByType.ItemContainerGenerator.ItemFromContainer(container) as InstanceAnswerPro.Core.Community.Community; if ((community != null) && Util_Group.IsManager(community, Util_Buddy.GetCurrentBuddy().Uin)) { Util_Group.OpenCommunityInfoWindow(community, Util_Group.CommunityInfoWindowPageTag.PageMemberInfo); } } } }
/// <summary> /// 检查点击对象,执行相应操作,主要是QZone /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void OnItemClicked(object sender, MouseButtonEventArgs e) { DependencyObject originalSource = e.OriginalSource as DependencyObject; if ((originalSource != null) && IsQZoneFlag(originalSource)) { ListBox ancestorByType = VisualTree.GetAncestorByType(originalSource, typeof(ListBox)) as ListBox; ListBoxItem container = VisualTree.GetAncestorByType(originalSource, typeof(ListBoxItem)) as ListBoxItem; if ((ancestorByType != null) && (container != null)) { Buddy buddy = ancestorByType.ItemContainerGenerator.ItemFromContainer(container) as Buddy; if (buddy != null) { Util_Buddy.ViewQZone(buddy, null); } } e.Handled = true; } }
private void MouseEvent(object sender, MouseEventArgs e) { if (e.RoutedEvent == Mouse.MouseEnterEvent) { if (e.Source == this.texttitle) { this.texttitle.TextDecorations = TextDecorations.Underline; } else if (e.Source == this.textcontent) { this.textcontent.TextDecorations = TextDecorations.Underline; } } else if (e.RoutedEvent == Mouse.MouseLeaveEvent) { if (e.Source == this.texttitle) { this.texttitle.TextDecorations = null; } else if (e.Source == this.textcontent) { this.textcontent.TextDecorations = null; } } else if (e.RoutedEvent == UIElement.MouseLeftButtonUpEvent) { if (base.DataContext is Buddy) { Buddy dataContext = base.DataContext as Buddy; if ((e.Source == this.texttitle) || (e.Source == this.textcontent)) { Util_Buddy.ViewQZone(dataContext, dataContext.QZoneInfo.AbstractUrl); } } } else if (e.RoutedEvent == UIElement.MouseLeftButtonDownEvent) { e.Handled = true; } }
public void AddSession(SessionTabItem sessionTabItem) { sessionTabItem.MessageIndex = 0; sessionTabItem.MessageAdded += new EventHandler <EventArgs>(this.OnMessageAdded); if (sessionTabItem.InputBoxDocument == null) { sessionTabItem.InputBoxDocument = new FlowDocument(); } this.sessionTabItems.Add(sessionTabItem); this.CurrentSessionTabItem = sessionTabItem; this.CurrentSessionTabItem.CommunitySession.Community.CommunityManager.RefreshCommunityFromServer(); this.CurrentSessionTabItem.CommunitySession.Community.CommunityManager.UpdateMemberStatus(true); this.CurrentSessionTabItem.CommunitySession.Community.CommunityManager.UpdateMemCardInfo(Util_Buddy.GetCurrentBuddy().Uin); }