private void p2pFileTransmit1_fileTransmitting(object sender, fileTransmitEvnetArgs e) { TransmittingDelegate d = new TransmittingDelegate(Transmitting); this.BeginInvoke(d,sender,e ); }
private void TransmitBefore(object sender, fileTransmitEvnetArgs e) { if (e.isSend) this.labelState.Text = "���ڷ����ļ�..."; else this.labelState.Text = "���ڽ����ļ�..."; if (this.fileTransmitBefore != null) this.fileTransmitBefore(this, e); }
private void p2pFileTransmit1_fileTransmitError(object sender, fileTransmitEvnetArgs e) { if (this.fileTransmitError != null) this.fileTransmitError(this, e); }
private void p2pFileTransmit1_fileTransmitOutTime(object sender, fileTransmitEvnetArgs e) { if (this.fileTransmitOutTime != null) this.fileTransmitOutTime(this, e); }
private void Cancel(object sender, fileTransmitEvnetArgs e) { if (this.fileTransmitCancel != null) this.fileTransmitCancel(this, e); }
private void p2pFileTransmit1_fileTransmitCancel(object sender, fileTransmitEvnetArgs e) { CancelDelegate d=new CancelDelegate(Cancel); this.BeginInvoke(d,sender,e); }
private void ftpClient_ImageGetFileSucceedEvent(FTPClient sender, string args) { CSS.IM.Library.Controls.fileTransmitEvnetArgs e = new fileTransmitEvnetArgs(false, Util.receiveImage + args, args, null, 0, 0, args); imageTransmittedDelegate d = new imageTransmittedDelegate(imageTransmitted); this.BeginInvoke(d, null, e); }
/// <summary> /// 文件传输组件事件:取消文件传输 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void fSend_fileTransmitCancel(object sender, fileTransmitEvnetArgs e) { p2pFile FileSend = (sender as p2pFile); delTabItem(FileSend);//删除文件传输Tab控件 if (e.isSend) //this.infoMessage1.showMsg("您已经取消了文件 " + e.fileName + " 的传输."); AppendSystemRtf("您已经取消了文件 " + e.fileName + " 的传输."); else AppendSystemRtf("对方已经取消了文件 " + e.fileName + " 的传输!"); Msg msg = new Msg((byte)ProtocolClient.FileTransmitCancel, TextEncoder.textToBytes(e.FileMD5Value)); sockUDP1.Send(BaseRemotUDPIP, BaseRemotUDPPort, msg.getBytes()); }
private void imageTransmitted(object sender, fileTransmitEvnetArgs e) { //Calculate.WirteLog(e.isSend.ToString() + "图片完成传输(" + e.currTransmittedLen.ToString() + "/" + e.fileLen.ToString() + ")"); if (!e.isSend)//如果是图片接收者,则将传输完成的图片显示出来 { MyPicture pic = this.RTBRecord.findPic(e.FileMD5Value); if (pic != null) { pic.Image = System.Drawing.Image.FromFile(e.fullFileName);//显示图片 pic.Invalidate(); this.RTBRecord.Invalidate(); } } p2pFileTransmitEX p2pImage = sender as p2pFileTransmitEX; this.imageP2Ps.Romove(p2pImage);//在传输队列中删除文件传输组件 if (p2pImage != null) p2pImage.Dispose(); }
/// <summary> /// 图片传输完成事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void imageTransmit_fileTransmitted(object sender, fileTransmitEvnetArgs e) { imageTransmittedDelegate d = new imageTransmittedDelegate(imageTransmitted); this.BeginInvoke(d, sender, e); }
/// <summary> /// 文件传输组件事件:文件传输结束 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void fSend_fileTransmitted(object sender, fileTransmitEvnetArgs e) { p2pFile FileSend = (sender as p2pFile); delTabItem(FileSend);//删除文件传输Tab控件 if (e.isSend) //this.infoMessage1.showMsg("文件 " + e.fileName + " 已经传输完成."); AppendSystemRtf("文件 " + e.fileName + " 已经传输完成."); else { //this.infoMessage1.showMsg("文件 " + e.fileName + " 已经传输完成."); AppendSystemRtf("文件 " + e.fileName + " 已经传输完成."); AppendSystemRtf("文件 " + e.fileName + " 已经传输完成,保存路径<file:\\\\" + e.fullFileName + ">"); } }
/// <summary> /// 文件传输组件事件:文件传输结束 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void fSend_fileTransmitOutTime(object sender, fileTransmitEvnetArgs e) { AppendSystemRtf(" 文件传输超时!"); }
/// <summary> /// 文件传输组件事件:文件传输错误 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void fSend_fileTransmitError(object sender, fileTransmitEvnetArgs e) { }
private void Transmitted(object sender, fileTransmitEvnetArgs e) { if (this.fileTransmitted != null) this.fileTransmitted(this, e); }
/// <summary> /// 传输图片超时 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void imageTransmit_fileTransmitOutTime(object sender, fileTransmitEvnetArgs e) { System.Diagnostics.Debug.WriteLine("传输文件超时"+e.errorMessage); }
private void Transmitting(object sender, fileTransmitEvnetArgs e) { this.PBar1.Position = e.currTransmittedLen;//���ý�������ʾ���� if ( Calculate.DateDiff(this.lastTime, System.DateTime.Now) > 1)//һ���Ӽ���һ�δ����ٶ� { this.labProcess.Text = "ʣ��" + Calculate.getResidualTime(e.fileLen, e.currTransmittedLen, this.lastTransmitLen);//����ļ�����ʣ��ʱ�� this.labProcess.Text += "\n(" + Calculate.GetSizeStr(e.currTransmittedLen) + "/" + this.p2pFileTransmit1.FileLenStr + ")\n"; this.lastTime = System.DateTime.Now; this.lastTransmitLen = e.currTransmittedLen; } if (this.fileTransmitting != null) this.fileTransmitting(this, e); }
/// <summary> /// 文件传输组件事件:文件传输数据包开始发送前 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void fSend_fileTransmitBefore(object sender, fileTransmitEvnetArgs e) { if (!e.isSend) //this.infoMessage1.showMsg("您已经接收了文件 " + e.fileName + " 的传输,文件正在传输中..."); AppendSystemRtf("您已经接收了文件 " + e.fileName + " 的传输,文件正在传输中..."); else //this.infoMessage1.showMsg("对方已经接收了文件 " + e.fileName + " 的传输,文件正在传输中..."); AppendSystemRtf("对方已经接收了文件 " + e.fileName + " 的传输,文件正在传输中..."); }