Esempio n. 1
0
        private BaseTab FindChatTab(MessageActorType type, long id, string projectid)
        {
            INWindow inWindow = this.dataService.INWindow as INWindow;
            BaseTab  result;

            if (inWindow != null)
            {
                ItemCollection ic = inWindow.ContentTab.Items;
                foreach (TabItem item in (System.Collections.IEnumerable)ic)
                {
                    if (item != null)
                    {
                        BaseTab cti = item as BaseTab;
                        if (MessageActorType.EntGroup == type)
                        {
                            GroupChatTabControl gctc = item.Content as GroupChatTabControl;
                            if (gctc != null && gctc.GroupId == id)
                            {
                                result = cti;
                                return(result);
                            }
                        }
                        if (MessageActorType.EntStaff == type)
                        {
                            PersonalChatTabControl pctc = item.Content as PersonalChatTabControl;
                            if (pctc != null && pctc.StaffId == id)
                            {
                                result = cti;
                                return(result);
                            }
                        }
                        if (MessageActorType.Roster == type)
                        {
                            FriendsChatTabControl fctc = item.Content as FriendsChatTabControl;
                            if (fctc != null && fctc.RosterId == id)
                            {
                                result = cti;
                                return(result);
                            }
                        }
                        if (MessageActorType.CooperationStaff == type)
                        {
                            CoopStaffChatTabControl coopStaffChatTabControl = item.Content as CoopStaffChatTabControl;
                            if (coopStaffChatTabControl != null && coopStaffChatTabControl.Uid == id && coopStaffChatTabControl.Projectid == projectid)
                            {
                                result = cti;
                                return(result);
                            }
                        }
                    }
                }
            }
            result = null;
            return(result);
        }
Esempio n. 2
0
 public RosterTab(Roster roster)
 {
     if (roster != null)
     {
         this.InitializeComponent();
         this.roster                   = roster;
         this.TabHeader.Label          = roster.Name;
         this.TabHeader.imgIcon.Source = roster.HeaderImage;
         base.Tag = new MenuItem
         {
             Icon = new Image
             {
                 Source = roster.HeaderImage
             },
             Header = roster.Name
         };
         this.TabContent = new FriendsChatTabControl(roster);
         base.SetFocus2DesktopButton();
         this.AddEventListenerHandler();
     }
 }