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();
     }
 }
        private void CooperationStaffNewMessage(Message message)
        {
            CoopStaffTab item = this.dataService.GetCooperationStaffChatTab((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId) as CoopStaffTab;

            if (item == null)
            {
                CooperationStaff          staff = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId);
                CooperationProjectWrapper cooperationProjectWrapper = this.dataService.GetCooperationProjectWrapper(message.ProjectId);
                if (staff != null && cooperationProjectWrapper != null)
                {
                    item = new CoopStaffTab(staff, cooperationProjectWrapper);
                    item.SetDefaultStyle();
                    ((INWindow)this.dataService.INWindow).ContentTab.Items.Add(item);
                    this.dataService.AddCooperationStaffChatTab(staff.Uid, staff.UnitedProjectid, item);
                }
            }
            this.baseTab = item;
            CoopStaffChatTabControl tab = item.TabContent;

            if (tab != null)
            {
                tab.ChatComponent.AddCooperationMessageStaff(message, false);
                tab.ChatComponent.inputMsgBox.Focus();
            }
        }
 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();
     }
 }
 public CoopStaffChatTabControl(CooperationStaff staff, CooperationProjectWrapper project)
 {
     if (staff != null && project != null)
     {
         this.InitializeComponent();
         this.profilePage = new CooperationUserProfilePage(staff);
         this.Staff = staff;
         this.CooperationProjectWrapper = project;
         this.userHead.ImageSource = staff.HeaderImage42;
         this.tbkName.Text = staff.Name;
         this.tbkID.Text = "(" + staff.Uid + ")";
         this.tbkSignature.Text = staff.Signature;
         this.tbkToolTip.Text = staff.Signature;
         this.ChatComponent.InitData(staff);
         this.ChatComponent.btnGroupShield.Visibility = Visibility.Collapsed;
         this.ChatComponent.PanelChangeContent.Children.Add(this.FileList);
         this.ChatComponent.PanelChangeContent.Children.Add(this.IShowPanel);
         this.ChatComponent.MsgRecordStatus = new ChatComponent.MsgRecordStatusDelegate(this.MsgRecordStatusHandle);
         this.ChatComponent.viewMsgBox.PreviewDragEnter += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.viewMsgBox.PreviewDragOver += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.viewMsgBox.PreviewDrop += new System.Windows.DragEventHandler(this.UserControl_Drop);
         this.ChatComponent.inputMsgBox.PreviewDragEnter += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.inputMsgBox.PreviewDragOver += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.inputMsgBox.PreviewDrop += new System.Windows.DragEventHandler(this.UserControl_Drop);
         this.ShowIShowPanel();
         this.userProfileFrame.NavigationService.Navigate(this.profilePage);
         this.InitUI();
     }
 }
 public CoopStaffChatTabControl(CooperationStaff staff, CooperationProjectWrapper project)
 {
     if (staff != null && project != null)
     {
         this.InitializeComponent();
         this.profilePage = new CooperationUserProfilePage(staff);
         this.Staff       = staff;
         this.CooperationProjectWrapper = project;
         this.userHead.ImageSource      = staff.HeaderImage42;
         this.tbkName.Text      = staff.Name;
         this.tbkID.Text        = "(" + staff.Uid + ")";
         this.tbkSignature.Text = staff.Signature;
         this.tbkToolTip.Text   = staff.Signature;
         this.ChatComponent.InitData(staff);
         this.ChatComponent.btnGroupShield.Visibility = Visibility.Collapsed;
         this.ChatComponent.PanelChangeContent.Children.Add(this.FileList);
         this.ChatComponent.PanelChangeContent.Children.Add(this.IShowPanel);
         this.ChatComponent.MsgRecordStatus               = new ChatComponent.MsgRecordStatusDelegate(this.MsgRecordStatusHandle);
         this.ChatComponent.viewMsgBox.PreviewDragEnter  += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.viewMsgBox.PreviewDragOver   += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.viewMsgBox.PreviewDrop       += new System.Windows.DragEventHandler(this.UserControl_Drop);
         this.ChatComponent.inputMsgBox.PreviewDragEnter += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.inputMsgBox.PreviewDragOver  += new System.Windows.DragEventHandler(this.TextBox_PreviewDragEnter);
         this.ChatComponent.inputMsgBox.PreviewDrop      += new System.Windows.DragEventHandler(this.UserControl_Drop);
         this.ShowIShowPanel();
         this.userProfileFrame.NavigationService.Navigate(this.profilePage);
         this.InitUI();
     }
 }
示例#6
0
 private void CloseCooperationTab()
 {
     System.Collections.Generic.ICollection <TabItem> staffChatTabs  = this.dataService.GetCooperationStaffChatTabList();
     System.Collections.Generic.List <TabItem>        temTabItemList = new System.Collections.Generic.List <TabItem>(staffChatTabs);
     for (int i = temTabItemList.Count - 1; i >= 0; i--)
     {
         CoopStaffTab temCoopStaffTab = temTabItemList[i] as CoopStaffTab;
         if (temCoopStaffTab != null)
         {
             CooperationStaff temCooperationStaff = this.dataService.GetCooperationStaff(temCoopStaffTab.Staff.Uid, temCoopStaffTab.Staff.UnitedProjectid);
             if (temCooperationStaff == null)
             {
                 this.dataService.RemoveCooperationStaffChatTab(temCoopStaffTab.Staff.Uid, temCoopStaffTab.Staff.UnitedProjectid);
                 if (this.INWindow.ContentTab.Items.Contains(temCoopStaffTab))
                 {
                     this.INWindow.ContentTab.Items.Remove(temCoopStaffTab);
                 }
             }
             else
             {
                 temCoopStaffTab.Staff = temCooperationStaff;
                 CooperationProjectWrapper temCooperationProjectWrapper = this.dataService.GetCooperationProjectWrapper(temCooperationStaff.UnitedProjectid);
                 if (temCooperationProjectWrapper != null)
                 {
                     temCoopStaffTab.CooperationProjectWrapper = temCooperationProjectWrapper;
                 }
             }
         }
     }
 }
示例#7
0
 public void SendCooperationDockingRequest(CooperationProjectWrapper cooperationProjectWrapper)
 {
     if (this.sessionService != null && this.connection != null && cooperationProjectWrapper != null)
     {
         CooperationDockingRequest req = new CooperationDockingRequest();
         req.Uid              = this.sessionService.Uid;
         req.ProjectID        = cooperationProjectWrapper.UnitedProjecid;
         req.requestProjectID = cooperationProjectWrapper.CooperationProject.ProjectID;
         req.jid              = this.sessionService.Jid;
         this.connection.Send(PacketType.COOPERATION_DOCKING, req);
     }
 }
 public CollaborationNodeStaff(CooperationStaff staff, CooperationProjectWrapper cooperationProjectWrapper)
 {
     this.InitializeComponent();
     this.logger = ServiceUtil.Instance.Logger;
     this.imageService = ServiceUtil.Instance.ImageService;
     this.sessionService = ServiceUtil.Instance.SessionService;
     this.dataService = ServiceUtil.Instance.DataService;
     this.fileService = ServiceUtil.Instance.FileService;
     this.cooperationProjectWrapper = cooperationProjectWrapper;
     this.staff = staff;
     this.staff_CooperationStaffUpdated(this.staff);
     base.DataContext = this.staff;
     this.staff.CooperationStaffUpdated += new CooperationStaffUpdatedHandler(this.staff_CooperationStaffUpdated);
     this.AddEventListenerHandler();
 }
示例#9
0
 public CollaborationNodeStaff(CooperationStaff staff, CooperationProjectWrapper cooperationProjectWrapper)
 {
     this.InitializeComponent();
     this.logger                    = ServiceUtil.Instance.Logger;
     this.imageService              = ServiceUtil.Instance.ImageService;
     this.sessionService            = ServiceUtil.Instance.SessionService;
     this.dataService               = ServiceUtil.Instance.DataService;
     this.fileService               = ServiceUtil.Instance.FileService;
     this.cooperationProjectWrapper = cooperationProjectWrapper;
     this.staff = staff;
     this.staff_CooperationStaffUpdated(this.staff);
     base.DataContext = this.staff;
     this.staff.CooperationStaffUpdated += new CooperationStaffUpdatedHandler(this.staff_CooperationStaffUpdated);
     this.AddEventListenerHandler();
 }
示例#10
0
 public void Add(CooperationProjectResponse resp)
 {
     this.TreeRoot.Visibility = Visibility.Visible;
     this.tbkTip.Visibility   = Visibility.Collapsed;
     foreach (CooperationProject item in resp.cooperationProject)
     {
         CooperationProjectWrapper cooperationProjectWrapper = new CooperationProjectWrapper(item);
         if (!this.dataService.ContainsCooperationProjectWrapper(cooperationProjectWrapper.UnitedProjecid))
         {
             TreeViewItem cooperationProjectNode = new TreeViewItem();
             cooperationProjectNode.Style = (base.TryFindResource("TreeViewItemStyle") as Style);
             CollaborationTreeViewItem uscCooperationProject = new CollaborationTreeViewItem(item);
             cooperationProjectNode.Header = uscCooperationProject;
             this.TreeRoot.Items.Add(cooperationProjectNode);
             this.dataService.AddCooperationProjectWrapper(cooperationProjectWrapper);
             this.dataService.AddCooperationProjectTvi(cooperationProjectWrapper.UnitedProjecid, cooperationProjectNode);
         }
     }
 }
 public void Add(CooperationProjectResponse resp)
 {
     this.TreeRoot.Visibility = Visibility.Visible;
     this.tbkTip.Visibility = Visibility.Collapsed;
     foreach (CooperationProject item in resp.cooperationProject)
     {
         CooperationProjectWrapper cooperationProjectWrapper = new CooperationProjectWrapper(item);
         if (!this.dataService.ContainsCooperationProjectWrapper(cooperationProjectWrapper.UnitedProjecid))
         {
             TreeViewItem cooperationProjectNode = new TreeViewItem();
             cooperationProjectNode.Style = (base.TryFindResource("TreeViewItemStyle") as Style);
             CollaborationTreeViewItem uscCooperationProject = new CollaborationTreeViewItem(item);
             cooperationProjectNode.Header = uscCooperationProject;
             this.TreeRoot.Items.Add(cooperationProjectNode);
             this.dataService.AddCooperationProjectWrapper(cooperationProjectWrapper);
             this.dataService.AddCooperationProjectTvi(cooperationProjectWrapper.UnitedProjecid, cooperationProjectNode);
         }
     }
 }
示例#12
0
 //internal Image imgIcon;
 //internal TextBlock tbkHeader;
 //internal TextBlock tbkCompany;
 ////private bool _contentLoaded;
 public CollaborationTreeViewItem(CooperationProject cooperationProject)
 {
     this.InitializeComponent();
     this.cooperationProject        = cooperationProject;
     this.cooperationProjectWrapper = new CooperationProjectWrapper(cooperationProject);
     if (this.cooperationProjectWrapper.IsSender)
     {
         this.imgIcon.Source = this.SetIcon("/IDKin.IM.Windows;component/Resources/Icon/senderIcon.png");
         this.imgIcon.Width  = 16.0;
         this.imgIcon.Height = 16.0;
     }
     else
     {
         this.imgIcon.Source = this.SetIcon("/IDKin.IM.Windows;component/Resources/Icon/receiveIcon.png");
         this.imgIcon.Width  = 16.0;
         this.imgIcon.Height = 16.0;
     }
     base.DataContext = this.cooperationProjectWrapper;
 }
 //internal Image imgIcon;
 //internal TextBlock tbkHeader;
 //internal TextBlock tbkCompany;
 ////private bool _contentLoaded;
 public CollaborationTreeViewItem(CooperationProject cooperationProject)
 {
     this.InitializeComponent();
     this.cooperationProject = cooperationProject;
     this.cooperationProjectWrapper = new CooperationProjectWrapper(cooperationProject);
     if (this.cooperationProjectWrapper.IsSender)
     {
         this.imgIcon.Source = this.SetIcon("/IDKin.IM.Windows;component/Resources/Icon/senderIcon.png");
         this.imgIcon.Width = 16.0;
         this.imgIcon.Height = 16.0;
     }
     else
     {
         this.imgIcon.Source = this.SetIcon("/IDKin.IM.Windows;component/Resources/Icon/receiveIcon.png");
         this.imgIcon.Width = 16.0;
         this.imgIcon.Height = 16.0;
     }
     base.DataContext = this.cooperationProjectWrapper;
 }
示例#14
0
        public void Add(CooperationDockingResponse resp)
        {
            TreeViewItem parentCooperationProjectNode           = null;
            CooperationProjectWrapper cooperationProjectWrapper = null;

            foreach (CooperationDocking item in resp.cooperationDocking)
            {
                if (parentCooperationProjectNode == null)
                {
                    parentCooperationProjectNode = this.dataService.GetCooperationProjectTvi(item.projectId);
                    if (parentCooperationProjectNode == null)
                    {
                        continue;
                    }
                }
                if (cooperationProjectWrapper == null)
                {
                    cooperationProjectWrapper = this.dataService.GetCooperationProjectWrapper(item.projectId);
                    if (cooperationProjectWrapper == null)
                    {
                        continue;
                    }
                }
                CooperationStaff cooperationStaff = new CooperationStaff(item);
                if (!this.dataService.ContainsCooperationStaff(cooperationStaff.Uid, cooperationStaff.UnitedProjectid))
                {
                    this.dataService.AddCooperationStaff(cooperationStaff);
                    CollaborationNodeStaff uscCollaborationNodeStaff = new CollaborationNodeStaff(cooperationStaff, cooperationProjectWrapper);
                    TreeViewItem           subCooperationStaffNode   = new TreeViewItem();
                    subCooperationStaffNode.Tag    = cooperationStaff;
                    subCooperationStaffNode.Style  = (base.TryFindResource("TreeViewItemStyle") as Style);
                    subCooperationStaffNode.Header = uscCollaborationNodeStaff;
                    parentCooperationProjectNode.Items.Add(subCooperationStaffNode);
                    this.dataService.AddCooperationStaffTvi(cooperationStaff.Uid, cooperationStaff.UnitedProjectid, subCooperationStaffNode);
                }
            }
        }
 public void SendCooperationDockingRequest(CooperationProjectWrapper cooperationProjectWrapper)
 {
     if (this.sessionService != null && this.connection != null && cooperationProjectWrapper != null)
     {
         CooperationDockingRequest req = new CooperationDockingRequest();
         req.Uid = this.sessionService.Uid;
         req.ProjectID = cooperationProjectWrapper.UnitedProjecid;
         req.requestProjectID = cooperationProjectWrapper.CooperationProject.ProjectID;
         req.jid = this.sessionService.Jid;
         this.connection.Send(PacketType.COOPERATION_DOCKING, req);
     }
 }