public void UpdateResumedProjectItem(ResumedProjectItem resumedProjectItem_0) { if (this.int_0 <= 0) { try { if (File.Exists(resumedProjectItem_0.LocalTempFileSavePath)) { File.Delete(resumedProjectItem_0.LocalTempFileSavePath); } } catch { } } else { lock (this.object_0) { if (!this.dictionary_0.ContainsKey(resumedProjectItem_0.SenderID)) { this.dictionary_0.Add(resumedProjectItem_0.SenderID, new List <ResumedProjectItem>()); } this.dictionary_0[resumedProjectItem_0.SenderID].Add(resumedProjectItem_0); this.SetResumedProjectItem(); } } }
public void RemoveResumedProjectItem(ResumedProjectItem resumedProjectItem_0, bool bool_0) { if ((resumedProjectItem_0 != null) && (this.int_0 > 0)) { lock (this.object_0) { if (this.dictionary_0.ContainsKey(resumedProjectItem_0.SenderID)) { if (bool_0 && File.Exists(resumedProjectItem_0.LocalTempFileSavePath)) { File.Delete(resumedProjectItem_0.LocalTempFileSavePath); } this.dictionary_0[resumedProjectItem_0.SenderID].Remove(resumedProjectItem_0); } } } }
private void method_3(string string_1, FileTransDisrupttedType fileTransDisrupttedType_0, string string_2) { TransferingProject project = this.GetTransferingProject(string_1); project.method_2(string_2); IFileTransHelper interface2 = this.iobjectManager_0.Get(string_1); ResumedProjectItem item = null; if (interface2.imethod_4()) { DirectoryReceiver class2 = (DirectoryReceiver)interface2; item = new ResumedProjectItem(project.SenderID, project.OriginPath, project.TotalSize, project.OriginLastUpdateTime, interface2.imethod_8(), interface2.imethod_7(), interface2.imethod_9(), class2.method_0(), class2.method_1(), class2.method_2()); } else { item = new ResumedProjectItem(project.SenderID, project.OriginPath, project.TotalSize, project.OriginLastUpdateTime, interface2.imethod_8(), interface2.imethod_7(), interface2.imethod_9()); } this.class93_0.UpdateResumedProjectItem(item); this.iobjectManager_1.Remove(string_1); this.iobjectManager_0.Remove(string_1); this.FileTransDisruptted(project, fileTransDisrupttedType_0); }
public ResumedProjectItem GetResumedProjectItem(TransferingProject transferingProject_0) { if (this.int_0 <= 0) { return(null); } ResumedProjectItem item2 = null; lock (this.object_0) { if (!this.dictionary_0.ContainsKey(transferingProject_0.SenderID)) { return(null); } foreach (ResumedProjectItem item3 in new List <ResumedProjectItem>(this.dictionary_0[transferingProject_0.SenderID])) { if ((((item3.OriginPath == transferingProject_0.OriginPath) && (item3.OriginSize == transferingProject_0.TotalSize)) && (item3.OriginLastUpdateTime == transferingProject_0.OriginLastUpdateTime)) && ((transferingProject_0.LocalSavePath == null) || (transferingProject_0.LocalSavePath == item3.LocalSavePath))) { if (File.Exists(item3.LocalTempFileSavePath)) { if (item2 == null) { item2 = item3; } else if (item3.DisrupttedTime > item2.DisrupttedTime) { item2 = item3; } } else { this.dictionary_0[transferingProject_0.SenderID].Remove(item3); } } } return(item2); } }
public void imethod_4(TransferingProject transferingProject_0, ResumedProjectItem resumedProjectItem_0, bool bool_0) { this.iobjectManager_2.Remove(transferingProject_0.ProjectID); if (!this.iobjectManager_1.Contains(transferingProject_0.ProjectID)) { this.iobjectManager_1.Add(transferingProject_0.ProjectID, transferingProject_0); bool flag = bool_0 && (resumedProjectItem_0 != null); IFileTransHelper interface2 = null; if (transferingProject_0.IsFolder) { DirectoryReceiver class2 = flag ? new DirectoryReceiver(this.RnOiFeTpq, transferingProject_0.ProjectID, string_0, resumedProjectItem_0) : new DirectoryReceiver(this.RnOiFeTpq, transferingProject_0.ProjectID, transferingProject_0.LocalSavePath, transferingProject_0.TotalSize, string_0); class2.FileTransReceived += new CbGeneric <string>(this.OnSingleFileRevFinished); interface2 = class2; } else if (transferingProject_0.LocalSaveStream == null) { interface2 = flag ? new FileReceiver(this.RnOiFeTpq, transferingProject_0.ProjectID, resumedProjectItem_0) : new FileReceiver(this.RnOiFeTpq, transferingProject_0.ProjectID, transferingProject_0.LocalSavePath, transferingProject_0.TotalSize, string_0); } else { interface2 = new Class124(this.RnOiFeTpq, transferingProject_0.ProjectID, transferingProject_0.LocalSaveStream, transferingProject_0.TotalSize); } interface2.FileTransCompleted += new CbGeneric <string>(this.OnFileTransCompleted); interface2.FileTransDisruptted += new CbFileTransDisruptted(this.method_3); interface2.FileTransProgress += new CbFileSendedProgress(this.OnFileTransProgress); this.iobjectManager_0.Add(transferingProject_0.ProjectID, interface2); this.class93_0.RemoveResumedProjectItem(resumedProjectItem_0, !flag); if (flag) { this.FileTransStarted(transferingProject_0); } else { this.FileTransCompleted(transferingProject_0); } } }
public FileReceiver(IAgileLogger iagileLogger_0, string string_3, ResumedProjectItem resumedProjectItem_0) { this.diYatLwGC = new EventSafeTrigger(new EmptyAgileLogger(), "XrZokLIgmVlcsHl3C7.nxZXDMlUfKsyJYxeVn"); this.emptyAgileLogger_0 = new EmptyAgileLogger(); this.ulong_0 = 0L; this.HtwoUmmJj = ""; this.object_0 = 0; this.int_0 = 0; this.byte_0 = 0; this.filePackage_0 = new FilePackage[0x100]; this.int_1 = 0; this.bool_0 = false; this.emptyAgileLogger_0 = (EmptyAgileLogger)iagileLogger_0; this.HtwoUmmJj = string_3; this.string_1 = resumedProjectItem_0.LocalTempFileSavePath; this.string_0 = resumedProjectItem_0.LocalSavePath; this.string_2 = FileHelper.GetFileNameNoPath(resumedProjectItem_0.LocalSavePath); this.fileStream_0 = new FileStream(this.string_1, FileMode.Open); this.fileStream_0.Seek((long)resumedProjectItem_0.ReceivedCount, SeekOrigin.Begin); this.ulong_1 = resumedProjectItem_0.OriginSize; this.ulong_0 = resumedProjectItem_0.ReceivedCount; if (cbGeneric_2 == null) { cbGeneric_2 = new CbGeneric <string>(FileReceiver.smethod_2); } this.FileTransCompleted += cbGeneric_2; if (cbFileTransDisruptted_2 == null) { cbFileTransDisruptted_2 = new CbFileTransDisruptted(FileReceiver.smethod_3); } this.FileTransDisruptted += cbFileTransDisruptted_2; if (cbFileSendedProgress_2 == null) { cbFileSendedProgress_2 = new CbFileSendedProgress(FileReceiver.smethod_4); } this.FileTransProgress += cbFileSendedProgress_2; }
public void BeginReceiveFile(string projectID, string savePath, bool allowResume) { if (savePath == null) { throw new Exception("The value of saveFilePath can't be null !"); } TransferingProject project = this.object_0.imethod_3(projectID); if (project != null) { project.LocalSavePath = savePath; project.TimeStarted = DateTime.Now; project.IsTransfering = true; ResumedProjectItem item = this.object_0.imethod_0(project); RejectOrAcceptFileContract body = null; if (project.IsFolder) { if (!((item != null) && allowResume)) { body = new RejectOrAcceptFileContract(projectID, true, 0L, null); } else { body = new RejectOrAcceptFileContract(projectID, true, item.ReceivedCount, null, item.DisrupttedFileRelativePath, item.DisrupttedFileSize, item.DisrupttedFileReceivedCount); } } else { ulong num = (!allowResume || (item == null)) ? ((ulong)0L) : item.ReceivedCount; body = new RejectOrAcceptFileContract(projectID, true, num, null); } this.object_0.imethod_4(project, item, allowResume); IMessageHandler interface2 = this.interface9_0.imethod_4 <RejectOrAcceptFileContract>(this.string_0, this.fileMessageTypeRoom_0.RejectOrAcceptFile, body, project.SenderID); this.SendMessage(interface2, false); } }
void do_fileOutter_FileRequestReceived(string projectID, string senderID, string projectName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment) { string offlineFileSenderID = Comment4OfflineFile.ParseUserID(comment); bool offlineFile = (offlineFileSenderID != null); if (offlineFile) { senderID = offlineFileSenderID; } ChatForm form = this.GetChatForm(senderID); form.FileRequestReceived(projectID, offlineFile); form.FlashChatWindow(true); }
//服务端要发送某个新版本的文件给客户端时,准备开始接收文件。 void fileOutter_FileRequestReceived(string projectID, string senderID, string fileName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment) { string relativePath = comment; string localSavePath = AppDomain.CurrentDomain.BaseDirectory + "temp\\" + relativePath; this.EnsureDirectoryExist(localSavePath); //准备开始接收文件 this.rapidPassiveEngine.FileOutter.BeginReceiveFile(projectID, localSavePath, true); }
void fileController_FileRequestReceived(string fileID, string senderID, string fileName, ulong fileLength, ResumedProjectItem resumedFileItem, string comment) { var paras = Comment4NDisk.Parse(comment); if (paras == null) { return; } if (resumedFileItem != null) { this.fileController.BeginReceiveFile(fileID, resumedFileItem.LocalSavePath); //续传 return; } var rootPath = this.networkDiskPathManager.GetNetworkDiskRootPath(senderID, paras.NetDiskID); this.fileController.BeginReceiveFile(fileID, rootPath + paras.DirectoryPath); }
public DirectoryReceiver(IAgileLogger iagileLogger_0, string string_5, string string_6, ResumedProjectItem resumedProjectItem_0) { this.eventSafeTrigger_0 = new EventSafeTrigger(new EmptyAgileLogger(), "XrZokLIgmVlcsHl3C7.nxZXDMlUfKsyJYxeVn"); this.emptyAgileLogger_0 = new EmptyAgileLogger(); this.ulong_0 = 0L; this.ulong_1 = 0L; this.ulong_2 = 0L; this.string_3 = ""; this.ulong_4 = 0L; this.emptyAgileLogger_0 = (EmptyAgileLogger)iagileLogger_0; this.string_3 = string_5; this.string_0 = resumedProjectItem_0.LocalSavePath; this.string_4 = string_6; string[] strArray = this.string_0.Trim().Split(new char[] { '\\' }); this.object_0 = strArray[strArray.Length - 2]; this.ulong_3 = resumedProjectItem_0.OriginSize; this.ulong_0 = resumedProjectItem_0.ReceivedCount; if (cbGeneric_3 == null) { cbGeneric_3 = new CbGeneric <string>(DirectoryReceiver.smethod_3); } this.FileTransCompleted += cbGeneric_3; if (cbFileTransDisruptted_2 == null) { cbFileTransDisruptted_2 = new CbFileTransDisruptted(DirectoryReceiver.smethod_4); } this.FileTransDisruptted += cbFileTransDisruptted_2; if (cbFileSendedProgress_2 == null) { cbFileSendedProgress_2 = new CbFileSendedProgress(DirectoryReceiver.smethod_5); } this.FileTransProgress += cbFileSendedProgress_2; this.ulong_4 = resumedProjectItem_0.ReceivedCount - resumedProjectItem_0.DisrupttedFileReceivedCount; string str = this.string_0 + resumedProjectItem_0.DisrupttedFileRelativePath; this.enisnmwGbe = new FileReceiver(this.emptyAgileLogger_0, this.string_3, resumedProjectItem_0.LocalTempFileSavePath, str, resumedProjectItem_0.DisrupttedFileSize, resumedProjectItem_0.DisrupttedFileReceivedCount); this.enisnmwGbe.FileTransDisruptted += new CbFileTransDisruptted(this.method_5); this.enisnmwGbe.FileTransCompleted += new CbGeneric <string>(this.OnFileTransCompleted); this.enisnmwGbe.FileTransProgress += new CbFileSendedProgress(this.method_3); }
void fileController_FileRequestReceived(string projectID, string senderID, string fileName, ulong totalSize, ResumedProjectItem resumedFileItem, string savePath) { this.fileController.BeginReceiveFile(projectID, savePath); }
void fileOutter_FileRequestReceived(string projectID, string senderID, string fileName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment) { NDiskParameters paras = Comment4NDisk.Parse(comment); if (paras == null) { return; } //string savePath = resumedFileItem != null ? resumedFileItem.LocalSavePath : comment; //上述bug,2014.11.04修复 string savePath = resumedFileItem != null ? resumedFileItem.LocalSavePath : paras.DirectoryPath; string fullPath = this.ConstructFullPath(savePath); if (savePath != null && savePath.Length >= 2 && savePath[1] == ':') //表示为含驱动器的绝对路径。 { fullPath = savePath; } this.fileOutter.BeginReceiveFile(projectID, fullPath); }
protected IMessageHandler method_5(IMessageHandler interface37_0) { TransferingProject project; CancelFileContract contract2; FileTransDisrupttedType type; if (interface37_0.Header.MessageType == this.object_0.BeginSendFile) { BeginSendFileContract contract3 = this.interface9_0.imethod_1 <BeginSendFileContract>(interface37_0); project = new TransferingProject(contract3.ProjectID, contract3.IsFolder, contract3.OriginPath, contract3.LastUpdateTime, interface37_0.Header.DestUserID, interface37_0.Header.UserID, contract3.TotalSize, false, contract3.Comment); ResumedProjectItem item = this.interface1_0.imethod_0(project); this.interface1_0.imethod_1(project); this.class26_0.method_9(contract3.ProjectID, interface37_0.Header.UserID, FileHelper.GetFileNameNoPath(contract3.OriginPath), contract3.TotalSize, item, contract3.Comment); return(null); } if (interface37_0.Header.MessageType == this.object_0.RejectOrAcceptFile) { RejectOrAcceptFileContract contract = this.interface9_0.imethod_1 <RejectOrAcceptFileContract>(interface37_0); project = this.interface7_0.imethod_2(contract.ProjectID); if (project != null) { project.method_2(contract.RejectCause); this.class26_0.method_7(project, contract.Agree); if (contract.Agree) { project.TimeStarted = DateTime.Now; project.IsTransfering = true; this.interface7_0.HnFdepcbbe(contract.ProjectID, contract.ReceivedCount, contract.DisrupttedFileRelativePath, contract.DisrupttedFileReceivedCount); } else { this.interface7_0.imethod_7(contract.ProjectID, FileTransDisrupttedType.RejectAccepting, null); } } return(null); } if (interface37_0.Header.MessageType == this.object_0.FilePackageData) { FilePackage package = this.interface9_0.imethod_1 <FilePackage>(interface37_0); this.interface1_0.ocqOcyhOmB(interface37_0.Header.UserID, package); return(null); } if (interface37_0.Header.MessageType == this.object_0.CancelFileSending) { contract2 = this.interface9_0.imethod_1 <CancelFileContract>(interface37_0); type = contract2.InnerError ? FileTransDisrupttedType.DestInnerError : FileTransDisrupttedType.DestCancel; this.interface1_0.imethod_5(contract2.ProjectID, type, contract2.Cause); return(null); } if (interface37_0.Header.MessageType == this.object_0.CancelFileReceiving) { contract2 = this.interface9_0.imethod_1 <CancelFileContract>(interface37_0); type = contract2.InnerError ? FileTransDisrupttedType.DestInnerError : FileTransDisrupttedType.DestCancel; this.interface7_0.imethod_7(contract2.ProjectID, type, contract2.Cause); return(null); } if (interface37_0.Header.MessageType == this.object_0.SingleFileRevFinishedNotify) { SingleFileNotifyContract contract4 = this.interface9_0.imethod_1 <SingleFileNotifyContract>(interface37_0); this.interface7_0.imethod_12(contract4.ProjectID); return(null); } return(null); }
void fileController_FileRequestReceived(string fileID, string senderID, string fileName, ulong fileLength, ResumedProjectItem resumedFileItem, string comment) { string directoryPath = Comment4NDisk.ParseDirectoryPath(comment); if (directoryPath == null) { return; } if (resumedFileItem != null) { this.fileController.BeginReceiveFile(fileID, resumedFileItem.LocalSavePath); //续传 return; } string rootPath = this.networkDiskPathManager.GetNetworkDiskRootPath(senderID); this.fileController.BeginReceiveFile(fileID, rootPath + directoryPath); }
private void SpringFileRequestReceived(string string_1, string string_2, string string_3, ulong ulong_0, ResumedProjectItem resumedProjectItem_0, string string_4) { try { if (this.FileRequestReceived != null) { this.FileRequestReceived(string_1, string_2, string_3, ulong_0, resumedProjectItem_0, string_4); } } catch (Exception exception) { this.emptyAgileLogger_0.Log(exception, "CJPlus.Application.FileTransfering.BaseFileController.SpringFileRequestReceived", ErrorLevel.Standard); } }
internal void method_9(string string_1, string string_2, string string_3, ulong ulong_0, ResumedProjectItem resumedProjectItem_0, string string_4) { if (this.FileRequestReceived != null) { new CbFileRequestReceived(this.SpringFileRequestReceived).BeginInvoke(string_1, string_2, string_3, ulong_0, resumedProjectItem_0, string_4, null, null); } }
public void RemoveResumedProjectItem(ResumedProjectItem resumedProjectItem_0, bool bool_0) { }
public void UpdateResumedProjectItem(ResumedProjectItem resumedProjectItem_0) { }
void fileOutter_FileRequestReceived(string projectID, string senderID, string projectName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment) { NDiskParameters para = Comment4NDisk.Parse(comment); if (para != null) //表明为网盘或远程磁盘 { return; } GlobalResourceManager.UiSafeInvoker.ActionOnUI<string, string, string, ulong, ResumedProjectItem, string>(this.do_fileOutter_FileRequestReceived, projectID, senderID, projectName, totalSize, resumedFileItem, comment); }
void fileOutter_FileRequestReceived(string projectID, string senderID, string projectName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment) { NDiskParameters para = Comment4NDisk.Parse(comment); if (para != null) //表明为网盘或远程磁盘 { return; } GlobalResourceManager.UiSafeInvoker.ActionOnUI <string, string, string, ulong, ResumedProjectItem, string>(this.do_fileOutter_FileRequestReceived, projectID, senderID, projectName, totalSize, resumedFileItem, comment); }
/// <summary> /// File request received. /// </summary> /// <param name="projectID">project id</param> /// <param name="senderID">sender id</param> /// <param name="fileName">file name</param> /// <param name="totalSize">total size</param> /// <param name="resumedFileItem">resumed file item</param> /// <param name="comment">comment</param> void FileOutter_FileRequestReceived(string projectID, string senderID, string fileName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment) { string relativePath = comment; string localSavePath = AppDomain.CurrentDomain.BaseDirectory + "temp\\"; if (!Directory.Exists(localSavePath)) { Directory.CreateDirectory(localSavePath); } mRapidPassiveEngine.FileOutter.BeginReceiveFile(projectID, localSavePath + relativePath, true); }
//当收到对方文件发送的请求时 的处理 void fileOutter_FileRequestReceived(string fileID, string senderID, string fileName, ulong totalSize, ResumedProjectItem resumedProjectItem, string comment) { if (this.InvokeRequired) { this.Invoke(new CbGeneric <string, string, string, ulong, ResumedProjectItem, string>(this.fileOutter_FileRequestReceived), fileID, senderID, fileName, totalSize, resumedProjectItem, comment); } else { ChatForm form = this.chatFormManager.GetForm(senderID); if (form == null) { form = new ChatForm(this.userID, senderID, this.rapidPassiveEngine.CustomizeOutter, this.rapidPassiveEngine.FileOutter); this.chatFormManager.Add(form); form.Show(); } form.Focus(); form.OnFileRequest(fileID, senderID, fileName); } }
void fileOutter_FileRequestReceived(string projectID, string senderID, string fileName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment) { string directoryPath = Comment4NDisk.ParseDirectoryPath(comment); if (directoryPath == null) { return; } //string savePath = resumedFileItem != null ? resumedFileItem.LocalSavePath : comment; //上述bug,2014.11.04修复 string savePath = resumedFileItem != null ? resumedFileItem.LocalSavePath : directoryPath; string fullPath = this.ConstructFullPath(savePath); if (savePath != null && savePath.Length >= 2 && savePath[1] == ':') //表示为含驱动器的绝对路径。 { fullPath = savePath; } this.fileOutter.BeginReceiveFile(projectID, fullPath); }