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();
     }
 }
 private void staff_CooperationStaffUpdated(CooperationStaff cooperationStaff)
 {
     base.Dispatcher.BeginInvoke(new CooperationStaffUpdatedHandler(this.UpdateView), new object[]
     {
         cooperationStaff
     });
 }
 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 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();
     }
 }
Example #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;
                 }
             }
         }
     }
 }
        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();
            }
        }
Example #8
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();
 }
 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();
 }
 private void UpdateView(CooperationStaff cooperationStaff)
 {
     try
     {
         this.imageService.SetCooperationStaffHeaderImage(cooperationStaff);
         this.imageService.SetCooperationStaffStatusIcon(cooperationStaff);
         this.imageService.SetCooperationStaffHeaderImageOnline(cooperationStaff);
         this.fileService.DownloadCooperationStaffHeader(cooperationStaff);
         base.TabHead.Icon    = cooperationStaff.HeaderImage42;
         this.TabHeader.Label = cooperationStaff.Name;
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
 private void UpdateView(CooperationStaff cooperationStaff)
 {
     try
     {
         this.imageService.SetCooperationStaffHeaderImage(cooperationStaff);
         this.imageService.SetCooperationStaffStatusIcon(cooperationStaff);
         this.imageService.SetCooperationStaffHeaderImageOnline(cooperationStaff);
         this.fileService.DownloadCooperationStaffHeader(cooperationStaff);
         this.userHead.ImageSource = cooperationStaff.HeaderImage42;
         this.tbkName.Text         = cooperationStaff.Name;
         this.tbkID.Text           = "(" + cooperationStaff.Uid + ")";
         this.tbkSignature.Text    = cooperationStaff.Signature;
         this.tbkToolTip.Text      = cooperationStaff.Signature;
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
Example #12
0
 private void UpdateView(CooperationStaff cooperationStaff)
 {
     try
     {
         this.imageService.SetCooperationStaffHeaderImage(cooperationStaff);
         this.imageService.SetCooperationStaffStatusIcon(cooperationStaff);
         this.imageService.SetCooperationStaffHeaderImageOnline(cooperationStaff);
         this.fileService.DownloadCooperationStaffHeader(cooperationStaff);
         this.imgFace.bgHead.ImageSource = cooperationStaff.HeaderImage42;
         TreeViewItem cooperationProjectNode = this.dataService.GetCooperationProjectTvi(cooperationStaff.UnitedProjectid);
         if (cooperationProjectNode != null)
         {
             cooperationProjectNode.Items.SortDescriptions.Clear();
             cooperationProjectNode.Items.SortDescriptions.Add(new SortDescription("Tag", ListSortDirection.Ascending));
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
 public NewFileListItem(string fileName, string id, long size, CoopStaffChatTabControl coopStaffChatTab, CooperationStaff coopStaff, string iconBase64)
 {
     if (coopStaffChatTab != null && coopStaff != null)
     {
         this.InitializeComponent();
         this.coopStaffChatTab    = coopStaffChatTab;
         this.coopStaff           = coopStaff;
         this.item                = new FileItem(id, this.fileDir + fileName);
         this.item.FileService    = this.fileService;
         this.item.ProcessEvent   = new ProcessEvent(this.ProcessEventHandle);
         this.item.EndEvent       = new EndEvent(this.EndEventHandle);
         this.item.ErrorEvent     = new ErrorEvent(this.ErrorEventHandle);
         this.item.IconBase64     = iconBase64;
         this.IconBase64          = iconBase64;
         this.imgIcon.Source      = this.IconDecode(this.IconBase64);
         this.progressBar.Maximum = (double)size;
         this.tbkFilename.Text    = fileName;
         this.fileName            = fileName;
         this.tbkMsg.Text         = "收到文件请求";
         this.tbkSize.Text        = this.GetLength(size);
         this.ShowAcceptButton();
     }
 }
 public NewFileListItem(System.IO.FileInfo fileInfo, CoopStaffChatTabControl coopStaffChatTab, CooperationStaff coopStaff)
 {
     try
     {
         this.InitializeComponent();
         if (fileInfo != null && coopStaffChatTab != null && coopStaff != null)
         {
             this.fileInfo            = fileInfo;
             this.coopStaffChatTab    = coopStaffChatTab;
             this.coopStaff           = coopStaff;
             this.item                = new FileItem(fileInfo);
             this.item.IsToCenter     = true;
             this.item.Projectid      = coopStaff.UnitedProjectid;
             this.item.FromUid        = this.sessionService.Uid;
             this.item.ToJid          = coopStaff.Jid;
             this.item.ToUid          = coopStaff.Uid;
             this.item.FileService    = this.fileService;
             this.item.ProcessEvent   = new ProcessEvent(this.ProcessEventHandle);
             this.item.EndEvent       = new EndEvent(this.EndEventHandle);
             this.item.ErrorEvent     = new ErrorEvent(this.ErrorEventHandle);
             this.item.StopEvent      = new StopEvent(this.StopEventHandle);
             this.progressBar.Maximum = (double)fileInfo.Length;
             this.imgIcon.Source      = this.IconToBitmap(Icon.ExtractAssociatedIcon(fileInfo.FullName));
             this.IconBase64          = this.IconToBase64(Icon.ExtractAssociatedIcon(fileInfo.FullName));
             this.item.IconBase64     = this.IconBase64;
             this.tbkFilename.Text    = fileInfo.Name.Trim();
             this.fileName            = fileInfo.Name.Trim();
             this.tbkMsg.Text         = "正在发送文件";
             this.tbkSize.Text        = this.GetLength(fileInfo.Length);
             this.ShowCancelButton();
         }
     }
     catch (System.Exception e)
     {
         this.logger.Error(e.ToString());
     }
 }
Example #15
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 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);
         }
     }
 }
 private void UpdateView(CooperationStaff cooperationStaff)
 {
     try
     {
         this.imageService.SetCooperationStaffHeaderImage(cooperationStaff);
         this.imageService.SetCooperationStaffStatusIcon(cooperationStaff);
         this.imageService.SetCooperationStaffHeaderImageOnline(cooperationStaff);
         this.fileService.DownloadCooperationStaffHeader(cooperationStaff);
         this.imgFace.bgHead.ImageSource = cooperationStaff.HeaderImage42;
         TreeViewItem cooperationProjectNode = this.dataService.GetCooperationProjectTvi(cooperationStaff.UnitedProjectid);
         if (cooperationProjectNode != null)
         {
             cooperationProjectNode.Items.SortDescriptions.Clear();
             cooperationProjectNode.Items.SortDescriptions.Add(new SortDescription("Tag", ListSortDirection.Ascending));
         }
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
 private void staff_CooperationStaffUpdated(CooperationStaff cooperationStaff)
 {
     base.Dispatcher.BeginInvoke(new CooperationStaffUpdatedHandler(this.UpdateView), new object[]
     {
         cooperationStaff
     });
 }
        public TableRow CreateTableRowCooperationStaff(Message message, Block[] blocks, CooperationStaff staff)
        {
            TableRow tableRow = new TableRow();

            if (this.tableRowColor)
            {
                tableRow.Background = new SolidColorBrush(System.Windows.Media.Color.FromRgb(221, 253, 214));
            }
            else
            {
                tableRow.Background = new SolidColorBrush(System.Windows.Media.Color.FromRgb(241, 250, 255));
            }
            this.tableRowColor = !this.tableRowColor;
            TableCell tableCell = new TableCell();

            tableRow.Cells.Add(tableCell);
            tableCell.Blocks.Add(this.GetNameInfo(staff.Name, message.CreateTime, staff.Uid == this.sessionService.Uid));
            for (int i = 0; i < blocks.Length; i++)
            {
                Paragraph block = (Paragraph)blocks[i];
                this.SetParagraphStyle(block, message.Style);
                tableCell.Blocks.Add(block);
            }
            return(tableRow);
        }
 public NewFileListItem(System.IO.FileInfo fileInfo, CoopStaffChatTabControl coopStaffChatTab, CooperationStaff coopStaff)
 {
     try
     {
         this.InitializeComponent();
         if (fileInfo != null && coopStaffChatTab != null && coopStaff != null)
         {
             this.fileInfo = fileInfo;
             this.coopStaffChatTab = coopStaffChatTab;
             this.coopStaff = coopStaff;
             this.item = new FileItem(fileInfo);
             this.item.IsToCenter = true;
             this.item.Projectid = coopStaff.UnitedProjectid;
             this.item.FromUid = this.sessionService.Uid;
             this.item.ToJid = coopStaff.Jid;
             this.item.ToUid = coopStaff.Uid;
             this.item.FileService = this.fileService;
             this.item.ProcessEvent = new ProcessEvent(this.ProcessEventHandle);
             this.item.EndEvent = new EndEvent(this.EndEventHandle);
             this.item.ErrorEvent = new ErrorEvent(this.ErrorEventHandle);
             this.item.StopEvent = new StopEvent(this.StopEventHandle);
             this.progressBar.Maximum = (double)fileInfo.Length;
             this.imgIcon.Source = this.IconToBitmap(Icon.ExtractAssociatedIcon(fileInfo.FullName));
             this.IconBase64 = this.IconToBase64(Icon.ExtractAssociatedIcon(fileInfo.FullName));
             this.item.IconBase64 = this.IconBase64;
             this.tbkFilename.Text = fileInfo.Name.Trim();
             this.fileName = fileInfo.Name.Trim();
             this.tbkMsg.Text = "正在发送文件";
             this.tbkSize.Text = this.GetLength(fileInfo.Length);
             this.ShowCancelButton();
         }
     }
     catch (System.Exception e)
     {
         this.logger.Error(e.ToString());
     }
 }
 public NewFileListItem(string fileName, string id, long size, CoopStaffChatTabControl coopStaffChatTab, CooperationStaff coopStaff, string iconBase64)
 {
     if (coopStaffChatTab != null && coopStaff != null)
     {
         this.InitializeComponent();
         this.coopStaffChatTab = coopStaffChatTab;
         this.coopStaff = coopStaff;
         this.item = new FileItem(id, this.fileDir + fileName);
         this.item.FileService = this.fileService;
         this.item.ProcessEvent = new ProcessEvent(this.ProcessEventHandle);
         this.item.EndEvent = new EndEvent(this.EndEventHandle);
         this.item.ErrorEvent = new ErrorEvent(this.ErrorEventHandle);
         this.item.IconBase64 = iconBase64;
         this.IconBase64 = iconBase64;
         this.imgIcon.Source = this.IconDecode(this.IconBase64);
         this.progressBar.Maximum = (double)size;
         this.tbkFilename.Text = fileName;
         this.fileName = fileName;
         this.tbkMsg.Text = "收到文件请求";
         this.tbkSize.Text = this.GetLength(size);
         this.ShowAcceptButton();
     }
 }
 private void AddCooperationStaffMessage(Message message)
 {
     Block[] blocks = message.MessageBlocks;
     if (blocks != null && blocks.Length > 0)
     {
         CooperationStaff staff;
         if ((ulong)Jid.GetUid(message.FromJid) == (ulong)this.sessionService.Uid)
         {
             staff = new CooperationStaff();
             staff.Uid = this.sessionService.Uid;
             staff.Name = this.sessionService.Name;
         }
         else
         {
             staff = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId);
         }
         if (staff != null)
         {
             if (!string.IsNullOrEmpty(message.Url) && !string.IsNullOrEmpty(message.Icon) && !string.IsNullOrEmpty(message.FileName) && staff.Uid == this.sessionService.Uid)
             {
                 System.IO.FileInfo file = new System.IO.FileInfo(message.FileName);
                 OpenFileControl openFile = new OpenFileControl(new FileItem(file)
                 {
                     FileName = message.Url + message.FileName,
                     IconBase64 = message.Icon
                 }, true);
                 if (openFile != null && !string.IsNullOrEmpty(staff.Name))
                 {
                     Paragraph p = new Paragraph();
                     FlowDocument doc = this.ViewMessageBoxViewer.Document;
                     TableRow tableRow = new TableRow();
                     TableCell tableCell = new TableCell();
                     tableRow.Cells.Add(tableCell);
                     tableCell.Blocks.Add(this.GetNameInfo(staff.Name, message.CreateTime, staff.Uid == this.sessionService.Uid));
                     p.Inlines.Add(openFile);
                     doc.Blocks.Add(p);
                     tableCell.Blocks.Add(doc.Blocks.LastBlock);
                     this.trgMessageTable.Rows.Add(tableRow);
                 }
             }
             else
             {
                 TableRow tableRow = this.CreateTableRowCooperationStaff(message, blocks, staff);
                 this.trgMessageTable.Rows.Add(tableRow);
                 this.ScroolToEnd();
             }
         }
         else
         {
             TableRow tableRow = new TableRow();
             TableCell tableCell = new TableCell();
             tableRow.Cells.Add(tableCell);
             tableCell.Blocks.Add(this.GetNameInfo("此人已离职", message.CreateTime, (long)int.Parse(message.FromJid.Substring(0, message.FromJid.IndexOf("@"))) == this.sessionService.Uid));
             Block[] array = blocks;
             for (int i = 0; i < array.Length; i++)
             {
                 Paragraph block = (Paragraph)array[i];
                 this.SetParagraphStyle(block, message.Style);
                 tableCell.Blocks.Add(block);
             }
             this.trgMessageTable.Rows.Add(tableRow);
         }
     }
     this.DataSelect.Text = message.CreateTime.Substring(0, 10);
 }
 private void staff_CooperationStaffUpdated(CooperationStaff staff)
 {
     if (staff != null)
     {
         this.headBorder.Background = new ImageBrush
         {
             ImageSource = staff.HeaderImage
         };
         this.tbkHead.Text = staff.Name + "的头像";
         this.tbkPoto.Text = staff.Name + "的靓照";
         this.viewInfo.tbknickname.Text = staff.Nickname;
         this.viewInfo.tbkUsername.Text = staff.UserName;
         this.viewInfo.tbkrealname.Text = staff.Name;
         this.viewInfo.tbkkinID.Text = "(" + staff.Uid.ToString() + ")";
         if (staff.Job == "null")
         {
             this.viewInfo.tbkProfessional.Text = "";
         }
         else
         {
             this.viewInfo.tbkProfessional.Text = staff.Job;
         }
         this.viewInfo.tbkLevel.Text = null;
         if (staff.Sex == Sex.Female)
         {
             this.viewInfo.tbkSex.Text = "女";
         }
         else
         {
             if (staff.Sex == Sex.Male)
             {
                 this.viewInfo.tbkSex.Text = "男";
             }
             else
             {
                 this.viewInfo.tbkSex.Text = "保密";
             }
         }
         switch (staff.Sex)
         {
         case Sex.Female:
             this.LiangTuBorder.Background = new ImageBrush
             {
                 ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuFemale)
             };
             break;
         case Sex.Male:
             this.LiangTuBorder.Background = new ImageBrush
             {
                 ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuMale)
             };
             break;
         case Sex.Unknow:
             this.LiangTuBorder.Background = new ImageBrush
             {
                 ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuMale)
             };
             break;
         default:
             this.LiangTuBorder.Background = new ImageBrush
             {
                 ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuMale)
             };
             break;
         }
         if (staff.Signature == "null")
         {
             this.viewInfo.tbksignature.Text = "";
         }
         else
         {
             this.viewInfo.tbksignature.Text = staff.Signature;
         }
         if (staff.Birthday == "null")
         {
             this.viewInfo.tbkBirthday.Text = "";
         }
         else
         {
             this.viewInfo.tbkBirthday.Text = staff.Birthday;
         }
         this.viewInfo.tbkAge.Text = staff.Age.ToString();
         if (staff.Zodiac == "null")
         {
             this.viewInfo.tbkZodiac.Text = "";
         }
         else
         {
             this.viewInfo.tbkZodiac.Text = staff.Zodiac;
         }
         if (staff.Constellation == "null")
         {
             this.viewInfo.tbkConstellation.Text = "";
         }
         else
         {
             this.viewInfo.tbkConstellation.Text = staff.Constellation;
         }
         if (staff.BloodType == "null")
         {
             this.viewInfo.tbkBloodType.Text = "";
         }
         else
         {
             this.viewInfo.tbkBloodType.Text = staff.BloodType;
         }
         if (staff.Country == "null")
         {
             this.viewInfo.tbkCountry.Text = "";
         }
         else
         {
             this.viewInfo.tbkCountry.Text = staff.Country;
         }
         if (staff.City == "null")
         {
             this.viewInfo.tbkCity.Text = "";
         }
         else
         {
             this.viewInfo.tbkCity.Text = staff.City;
         }
         if (staff.Province == "null")
         {
             this.viewInfo.tbkProvince.Text = "";
         }
         else
         {
             this.viewInfo.tbkProvince.Text = staff.Province;
         }
         if (staff.ShowScope == 1)
         {
             this.viewInfo.tbkMobile.Text = staff.Mobile;
             this.viewInfo.tbkPhone.Text = staff.Telephone;
             this.viewInfo.tbkExtension.Text = staff.Extension;
             this.viewInfo.tbkEmail.Text = staff.Email;
             if (staff.Job == "null")
             {
                 this.viewInfo.tbkProfessional.Text = "";
             }
             else
             {
                 this.viewInfo.tbkProfessional.Text = staff.Job;
             }
             if (staff.School == "null")
             {
                 this.viewInfo.tbkSchool.Text = "";
             }
             else
             {
                 this.viewInfo.tbkSchool.Text = staff.School;
             }
             if (staff.MyHome == "null")
             {
                 this.viewInfo.tbkHome.Text = "";
             }
             else
             {
                 this.viewInfo.tbkHome.Text = staff.MyHome;
             }
             if (staff.MyDescription == "null")
             {
                 this.viewInfo.tbkDescription.Text = "";
             }
             else
             {
                 this.viewInfo.tbkDescription.Text = staff.MyDescription;
             }
             if (staff.Extension == "null")
             {
                 this.viewInfo.tbkExtension.Text = "";
             }
             else
             {
                 this.viewInfo.tbkExtension.Text = staff.Extension;
             }
         }
         else
         {
             if (staff.ShowScope == 2)
             {
                 this.viewInfo.tbkMobile.Text = string.Empty;
                 this.viewInfo.tbkPhone.Text = string.Empty;
                 this.viewInfo.tbkEmail.Text = string.Empty;
                 this.viewInfo.tbkProfessional.Text = string.Empty;
                 this.viewInfo.tbkSchool.Text = string.Empty;
                 this.viewInfo.tbkHome.Text = string.Empty;
                 this.viewInfo.tbkDescription.Text = string.Empty;
             }
         }
     }
 }
 public CooperationUserProfilePage(CooperationStaff staff)
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.Staff = staff;
 }
 private void UpdateView(CooperationStaff cooperationStaff)
 {
     try
     {
         this.imageService.SetCooperationStaffHeaderImage(cooperationStaff);
         this.imageService.SetCooperationStaffStatusIcon(cooperationStaff);
         this.imageService.SetCooperationStaffHeaderImageOnline(cooperationStaff);
         this.fileService.DownloadCooperationStaffHeader(cooperationStaff);
         base.TabHead.Icon = cooperationStaff.HeaderImage42;
         this.TabHeader.Label = cooperationStaff.Name;
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
 private void btnMsgRecord_Click(object sender, RoutedEventArgs e)
 {
     if (this.btnMsgRecord.IsChecked == true)
     {
         this.sessionService.IsChatPanelRecord = true;
         this.PanelChangeColumn.Width = new GridLength(0.0, GridUnitType.Auto);
         this.MsgRecordComp.Visibility = Visibility.Visible;
         if (this.staff != null)
         {
             this.MsgRecordComp.Type = MessageActorType.EntStaff;
             this.MsgRecordComp.Id = this.staff.Uid;
             this.viewModel.SendStaffMessageRecord(this.sessionService.Uid, this.staff.Uid, "0", 1, 10, MessageRecordType.MESSAGE_CHAT_RECORD);
         }
         else
         {
             if (this.group != null)
             {
                 this.MsgRecordComp.Type = MessageActorType.EntGroup;
                 this.MsgRecordComp.Id = this.group.Gid;
                 this.viewModel.SendGroupMessageRecord(this.group.Gid, "0", 1, 10, this.sessionService.Uid, MessageRecordType.MESSAGE_CHAT_RECORD);
             }
             else
             {
                 if (this.coopStaff != null)
                 {
                     this.MsgRecordComp.Type = MessageActorType.CooperationStaff;
                     this.MsgRecordComp.Id = this.coopStaff.Uid;
                     this.MsgRecordComp.CoopStaff = this.coopStaff;
                     this.viewModel.SendCooperationMessageRecordRequest(this.sessionService.Uid, this.coopStaff.Uid, this.coopStaff.UnitedProjectid, "0", 1, 10, MessageRecordType.MESSAGE_CHAT_RECORD);
                 }
             }
         }
     }
     else
     {
         this.MsgRecordComp.Visibility = Visibility.Collapsed;
         this.MsgRecordComp.InitPage();
         this.MsgRecordComp.Clear();
     }
     if (this.MsgRecordStatus != null)
     {
         this.MsgRecordStatus(this.btnMsgRecord.IsChecked == true);
     }
     this.sessionService.IsDateSearch = false;
 }
 public void InitData(CooperationStaff coopStaff)
 {
     this.coopStaff = coopStaff;
     this.InitService();
 }
 private void UpdateView(CooperationStaff cooperationStaff)
 {
     try
     {
         this.imageService.SetCooperationStaffHeaderImage(cooperationStaff);
         this.imageService.SetCooperationStaffStatusIcon(cooperationStaff);
         this.imageService.SetCooperationStaffHeaderImageOnline(cooperationStaff);
         this.fileService.DownloadCooperationStaffHeader(cooperationStaff);
         this.userHead.ImageSource = cooperationStaff.HeaderImage42;
         this.tbkName.Text = cooperationStaff.Name;
         this.tbkID.Text = "(" + cooperationStaff.Uid + ")";
         this.tbkSignature.Text = cooperationStaff.Signature;
         this.tbkToolTip.Text = cooperationStaff.Signature;
     }
     catch (System.Exception ex)
     {
         this.logger.Error(ex.ToString());
     }
 }
        private void staff_CooperationStaffUpdated(CooperationStaff staff)
        {
            if (staff != null)
            {
                this.headBorder.Background = new ImageBrush
                {
                    ImageSource = staff.HeaderImage
                };
                this.tbkHead.Text = staff.Name + "的头像";
                this.tbkPoto.Text = staff.Name + "的靓照";
                this.viewInfo.tbknickname.Text = staff.Nickname;
                this.viewInfo.tbkUsername.Text = staff.UserName;
                this.viewInfo.tbkrealname.Text = staff.Name;
                this.viewInfo.tbkkinID.Text    = "(" + staff.Uid.ToString() + ")";
                if (staff.Job == "null")
                {
                    this.viewInfo.tbkProfessional.Text = "";
                }
                else
                {
                    this.viewInfo.tbkProfessional.Text = staff.Job;
                }
                this.viewInfo.tbkLevel.Text = null;
                if (staff.Sex == Sex.Female)
                {
                    this.viewInfo.tbkSex.Text = "女";
                }
                else
                {
                    if (staff.Sex == Sex.Male)
                    {
                        this.viewInfo.tbkSex.Text = "男";
                    }
                    else
                    {
                        this.viewInfo.tbkSex.Text = "保密";
                    }
                }
                switch (staff.Sex)
                {
                case Sex.Female:
                    this.LiangTuBorder.Background = new ImageBrush
                    {
                        ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuFemale)
                    };
                    break;

                case Sex.Male:
                    this.LiangTuBorder.Background = new ImageBrush
                    {
                        ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuMale)
                    };
                    break;

                case Sex.Unknow:
                    this.LiangTuBorder.Background = new ImageBrush
                    {
                        ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuMale)
                    };
                    break;

                default:
                    this.LiangTuBorder.Background = new ImageBrush
                    {
                        ImageSource = this.imageService.GetHeader(ImageTypeHeader.LiangTuMale)
                    };
                    break;
                }
                if (staff.Signature == "null")
                {
                    this.viewInfo.tbksignature.Text = "";
                }
                else
                {
                    this.viewInfo.tbksignature.Text = staff.Signature;
                }
                if (staff.Birthday == "null")
                {
                    this.viewInfo.tbkBirthday.Text = "";
                }
                else
                {
                    this.viewInfo.tbkBirthday.Text = staff.Birthday;
                }
                this.viewInfo.tbkAge.Text = staff.Age.ToString();
                if (staff.Zodiac == "null")
                {
                    this.viewInfo.tbkZodiac.Text = "";
                }
                else
                {
                    this.viewInfo.tbkZodiac.Text = staff.Zodiac;
                }
                if (staff.Constellation == "null")
                {
                    this.viewInfo.tbkConstellation.Text = "";
                }
                else
                {
                    this.viewInfo.tbkConstellation.Text = staff.Constellation;
                }
                if (staff.BloodType == "null")
                {
                    this.viewInfo.tbkBloodType.Text = "";
                }
                else
                {
                    this.viewInfo.tbkBloodType.Text = staff.BloodType;
                }
                if (staff.Country == "null")
                {
                    this.viewInfo.tbkCountry.Text = "";
                }
                else
                {
                    this.viewInfo.tbkCountry.Text = staff.Country;
                }
                if (staff.City == "null")
                {
                    this.viewInfo.tbkCity.Text = "";
                }
                else
                {
                    this.viewInfo.tbkCity.Text = staff.City;
                }
                if (staff.Province == "null")
                {
                    this.viewInfo.tbkProvince.Text = "";
                }
                else
                {
                    this.viewInfo.tbkProvince.Text = staff.Province;
                }
                if (staff.ShowScope == 1)
                {
                    this.viewInfo.tbkMobile.Text    = staff.Mobile;
                    this.viewInfo.tbkPhone.Text     = staff.Telephone;
                    this.viewInfo.tbkExtension.Text = staff.Extension;
                    this.viewInfo.tbkEmail.Text     = staff.Email;
                    if (staff.Job == "null")
                    {
                        this.viewInfo.tbkProfessional.Text = "";
                    }
                    else
                    {
                        this.viewInfo.tbkProfessional.Text = staff.Job;
                    }
                    if (staff.School == "null")
                    {
                        this.viewInfo.tbkSchool.Text = "";
                    }
                    else
                    {
                        this.viewInfo.tbkSchool.Text = staff.School;
                    }
                    if (staff.MyHome == "null")
                    {
                        this.viewInfo.tbkHome.Text = "";
                    }
                    else
                    {
                        this.viewInfo.tbkHome.Text = staff.MyHome;
                    }
                    if (staff.MyDescription == "null")
                    {
                        this.viewInfo.tbkDescription.Text = "";
                    }
                    else
                    {
                        this.viewInfo.tbkDescription.Text = staff.MyDescription;
                    }
                    if (staff.Extension == "null")
                    {
                        this.viewInfo.tbkExtension.Text = "";
                    }
                    else
                    {
                        this.viewInfo.tbkExtension.Text = staff.Extension;
                    }
                }
                else
                {
                    if (staff.ShowScope == 2)
                    {
                        this.viewInfo.tbkMobile.Text       = string.Empty;
                        this.viewInfo.tbkPhone.Text        = string.Empty;
                        this.viewInfo.tbkEmail.Text        = string.Empty;
                        this.viewInfo.tbkProfessional.Text = string.Empty;
                        this.viewInfo.tbkSchool.Text       = string.Empty;
                        this.viewInfo.tbkHome.Text         = string.Empty;
                        this.viewInfo.tbkDescription.Text  = string.Empty;
                    }
                }
            }
        }
 private void AddCooperationStaffMessage(Message message)
 {
     Block[] blocks = message.MessageBlocks;
     if (blocks != null && blocks.Length > 0)
     {
         CooperationStaff staff;
         if ((ulong)Jid.GetUid(message.FromJid) == (ulong)this.sessionService.Uid)
         {
             staff      = new CooperationStaff();
             staff.Uid  = this.sessionService.Uid;
             staff.Name = this.sessionService.Name;
         }
         else
         {
             staff = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId);
         }
         if (staff != null)
         {
             if (!string.IsNullOrEmpty(message.Url) && !string.IsNullOrEmpty(message.Icon) && !string.IsNullOrEmpty(message.FileName) && staff.Uid == this.sessionService.Uid)
             {
                 System.IO.FileInfo file     = new System.IO.FileInfo(message.FileName);
                 OpenFileControl    openFile = new OpenFileControl(new FileItem(file)
                 {
                     FileName   = message.Url + message.FileName,
                     IconBase64 = message.Icon
                 }, true);
                 if (openFile != null && !string.IsNullOrEmpty(staff.Name))
                 {
                     Paragraph    p         = new Paragraph();
                     FlowDocument doc       = this.ViewMessageBoxViewer.Document;
                     TableRow     tableRow  = new TableRow();
                     TableCell    tableCell = new TableCell();
                     tableRow.Cells.Add(tableCell);
                     tableCell.Blocks.Add(this.GetNameInfo(staff.Name, message.CreateTime, staff.Uid == this.sessionService.Uid));
                     p.Inlines.Add(openFile);
                     doc.Blocks.Add(p);
                     tableCell.Blocks.Add(doc.Blocks.LastBlock);
                     this.trgMessageTable.Rows.Add(tableRow);
                 }
             }
             else
             {
                 TableRow tableRow = this.CreateTableRowCooperationStaff(message, blocks, staff);
                 this.trgMessageTable.Rows.Add(tableRow);
                 this.ScroolToEnd();
             }
         }
         else
         {
             TableRow  tableRow  = new TableRow();
             TableCell tableCell = new TableCell();
             tableRow.Cells.Add(tableCell);
             tableCell.Blocks.Add(this.GetNameInfo("此人已离职", message.CreateTime, (long)int.Parse(message.FromJid.Substring(0, message.FromJid.IndexOf("@"))) == this.sessionService.Uid));
             Block[] array = blocks;
             for (int i = 0; i < array.Length; i++)
             {
                 Paragraph block = (Paragraph)array[i];
                 this.SetParagraphStyle(block, message.Style);
                 tableCell.Blocks.Add(block);
             }
             this.trgMessageTable.Rows.Add(tableRow);
         }
     }
     this.DataSelect.Text = message.CreateTime.Substring(0, 10);
 }
 public TableRow CreateTableRowCooperationStaff(Message message, Block[] blocks, CooperationStaff staff)
 {
     TableRow tableRow = new TableRow();
     if (this.tableRowColor)
     {
         tableRow.Background = new SolidColorBrush(System.Windows.Media.Color.FromRgb(221, 253, 214));
     }
     else
     {
         tableRow.Background = new SolidColorBrush(System.Windows.Media.Color.FromRgb(241, 250, 255));
     }
     this.tableRowColor = !this.tableRowColor;
     TableCell tableCell = new TableCell();
     tableRow.Cells.Add(tableCell);
     tableCell.Blocks.Add(this.GetNameInfo(staff.Name, message.CreateTime, staff.Uid == this.sessionService.Uid));
     for (int i = 0; i < blocks.Length; i++)
     {
         Paragraph block = (Paragraph)blocks[i];
         this.SetParagraphStyle(block, message.Style);
         tableCell.Blocks.Add(block);
     }
     return tableRow;
 }
 public CooperationUserProfilePage(CooperationStaff staff)
 {
     ThemeSwitcher.LoadSkin(ThemeEnum.Aero, this);
     this.InitializeComponent();
     this.Staff = staff;
 }
Example #33
0
 public void Refresh()
 {
     try
     {
         this.lbMessageBox.Items.Clear();
         if (!this.dataModel.HasMessage())
         {
             NotifyIconUtil.Instance.SetFlashIcon(FlashIconType.Default);
             base.Close();
         }
         foreach (string key in this.dataModel.MessageBoxSort)
         {
             if (!string.IsNullOrEmpty(key))
             {
                 System.Collections.Generic.List <Message> list = this.dataModel.GetMessage(key);
                 if (list != null && list.Count > 0)
                 {
                     Message message = list[0];
                     if (message != null)
                     {
                         if (message.MessageObjectType == MessageActorType.EntStaff)
                         {
                             Staff staff = this.dataService.GetStaff((long)((ulong)Jid.GetUid(message.FromJid)));
                             if (staff != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.EntStaff, staff.Uid, staff.Name, list.Count.ToString(), staff.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.EntGroup)
                         {
                             EntGroup group = this.dataService.GetEntGroup(message.Gid);
                             if (group != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.EntGroup, group.Gid, group.Name, list.Count.ToString(), this.imageService.GetIcon(ImageTypeIcon.Group));
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.Roster)
                         {
                             Roster roster = this.dataService.GetRoster((long)((ulong)Jid.GetUid(message.FromJid)));
                             if (roster != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.Roster, roster.Uid, roster.Name, list.Count.ToString(), roster.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.AddRoster)
                         {
                             RosterAddRequest request = message.MessageObject as RosterAddRequest;
                             if (request != null && request.user != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.AddRoster, request.uid, "验证消息", list.Count.ToString(), null);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.AddRosterAsk)
                         {
                             RosterAddResponse response = message.MessageObject as RosterAddResponse;
                             if (response != null && response.user != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.AddRosterAsk, response.uid, "验证消息", list.Count.ToString(), null);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                         if (message.MessageObjectType == MessageActorType.CooperationStaff)
                         {
                             CooperationStaff staff2 = this.dataService.GetCooperationStaff((long)((ulong)Jid.GetUid(message.FromJid)), message.ProjectId);
                             if (staff2 != null)
                             {
                                 MessageBoxItem mbi = new MessageBoxItem(MessageActorType.CooperationStaff, staff2.Uid, staff2.UnitedProjectid, staff2.Name, list.Count.ToString(), staff2.HeaderImage);
                                 this.lbMessageBox.Items.Add(mbi);
                             }
                         }
                     }
                 }
             }
         }
         base.Top = SystemParameters.WorkArea.Height - 47.0 - (double)(this.lbMessageBox.Items.Count * 30);
     }
     catch (System.Exception e)
     {
         this.logger.Error(e.ToString());
     }
 }