public CoopStaffTab(CooperationStaff cooperationStaff, CooperationProjectWrapper cooperationProjectWrapper)
 {
     if (cooperationStaff != null)
     {
         this.InitializeComponent();
         this.imageService             = ServiceUtil.Instance.ImageService;
         this.fileService              = ServiceUtil.Instance.FileService;
         this.TabHeader.Label          = cooperationStaff.Name;
         this.TabHeader.imgIcon.Source = cooperationStaff.HeaderImage;
         base.Tag = new MenuItem
         {
             Icon = new Image
             {
                 Width  = 16.0,
                 Height = 16.0,
                 Source = cooperationStaff.HeaderImage
             },
             Header = cooperationStaff.Name
         };
         this.TabContent = new CoopStaffChatTabControl(cooperationStaff, cooperationProjectWrapper);
         this.Staff      = cooperationStaff;
         this.CooperationProjectWrapper = cooperationProjectWrapper;
         base.SetFocus2DesktopButton();
         this.AddEventListenerHandler();
     }
 }
示例#2
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);
        }
示例#3
0
        private void DisplayCooperationMessageRecordToChatPanel(System.Collections.Generic.List <CooperationMessageRecord> records, int total)
        {
            string projectid = records[0].project_id;
            long   staffUid;

            if (records[0].from_uid != this.sessionService.Uid)
            {
                staffUid = records[0].from_uid;
            }
            else
            {
                staffUid = records[0].to_uid;
            }
            Message[]    messages = new Message[records.Count];
            MessageStyle ms       = null;

            for (int i = 0; i < messages.Length; i++)
            {
                ms                     = this.CooperationMessageRecordProcessor(records, ms, i);
                messages[i]            = new Message();
                messages[i].FromJid    = records[i].from_uid + "@null/null";
                messages[i].CreateTime = records[i].createTime;
                messages[i].FileName   = records[i].fileName;
                messages[i].Icon       = records[i].icon;
                messages[i].Url        = records[i].url;
                messages[i].toUid      = records[i].to_uid;
                messages[i].ProjectId  = records[i].project_id;
                if (this.sessionService.Uid == records[i].to_uid)
                {
                    messages[i].ToJid = records[i].from_uid.ToString();
                }
                else
                {
                    messages[i].ToJid = records[i].to_uid.ToString();
                }
                messages[i].MessageBlocks = this.utilService.MessageDecode(records[i].message);
                messages[i].Style         = ms;
            }
            CoopStaffTab item = this.dataService.GetCooperationStaffChatTab(staffUid, projectid) as CoopStaffTab;

            if (item != null)
            {
                CoopStaffChatTabControl tab = item.TabContent;
                if (tab != null)
                {
                    tab.ChatComponent.AddCooperationStaffMessageRecords(messages, total);
                }
            }
        }