public NewFileListItem(System.IO.FileInfo fileInfo, PersonalChatTabControl staffChatTab, Staff staff)
 {
     try
     {
         this.InitializeComponent();
         if (fileInfo != null && staffChatTab != null && staff != null)
         {
             this.fileInfo            = fileInfo;
             this.staffChatTab        = staffChatTab;
             this.staff               = staff;
             this.item                = new FileItem(fileInfo);
             this.item.FromUid        = this.sessionService.Uid;
             this.item.ToJid          = this.staff.Jid;
             this.item.ToUid          = this.staff.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, PersonalChatTabControl staffChatTab, Staff staff, string iconBase64)
 {
     if (staffChatTab != null && staff != null)
     {
         this.InitializeComponent();
         this.staffChatTab        = staffChatTab;
         this.staff               = staff;
         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(string fileName, string id, long size, GroupChatTabControl groupChatTab, EntGroup group, string iconBase64, string userName)
 {
     if (groupChatTab != null && group != null)
     {
         this.InitializeComponent();
         this.groupChatTab        = groupChatTab;
         this.group               = group;
         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.userName            = userName;
         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.userName + "】的文件请求";
         this.tbkSize.Text        = this.GetLength(size);
         this.ShowAcceptButton();
     }
 }
 public NewFileListItem(System.IO.FileInfo fileInfo, GroupChatTabControl groupChatTab, EntGroup group)
 {
     try
     {
         this.InitializeComponent();
         if (fileInfo != null && groupChatTab != null && group != null)
         {
             this.fileInfo = fileInfo;
             this.groupChatTab = groupChatTab;
             this.group = group;
             this.item = new FileItem(fileInfo);
             this.item.FromUid = this.sessionService.Uid;
             this.item.Gid = this.group.Gid;
             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)
     {
         ServiceUtil.Instance.Logger.Error(e.ToString());
     }
 }
 public NewFileListItem(string fileName, string id, long size, PersonalChatTabControl staffChatTab, Staff staff, string iconBase64)
 {
     if (staffChatTab != null && staff != null)
     {
         this.InitializeComponent();
         this.staffChatTab = staffChatTab;
         this.staff = staff;
         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(string fileName, string id, long size, GroupChatTabControl groupChatTab, EntGroup group, string iconBase64, string userName)
 {
     if (groupChatTab != null && group != null)
     {
         this.InitializeComponent();
         this.groupChatTab = groupChatTab;
         this.group = group;
         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.userName = userName;
         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.userName + "】的文件请求";
         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());
     }
 }