Ejemplo n.º 1
0
    public void BeginSendFile(string accepterID, Stream stream, string projectName, ulong size, string comment, SendingFileParas paras, out string projectID)
    {
        if (accepterID == null)
        {
            accepterID = "_0";
        }
        projectID = Class23.smethod_0(this.string_0);
        this.fblKqUhvkd.imethod_6(accepterID, stream, projectName, size, projectID, paras, comment);
        BeginSendFileContract body       = new BeginSendFileContract(projectName, false, size, DateTime.Now, comment, projectID);
        IMessageHandler       interface2 = this.interface9_0.imethod_4 <BeginSendFileContract>(this.string_0, this.fileMessageTypeRoom_0.BeginSendFile, body, accepterID);

        this.SendMessage(interface2, false);
    }
Ejemplo n.º 2
0
    public void BeginSendFile(string accepterID, string fileOrDirPath, string comment, SendingFileParas paras, out string projectID)
    {
        bool flag;

        if (accepterID == null)
        {
            accepterID = "_0";
        }
        if (!(flag = Directory.Exists(fileOrDirPath)))
        {
            FileStream stream = File.Open(fileOrDirPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
            stream.Close();
            stream.Dispose();
        }
        projectID = Class23.smethod_0(this.string_0);
        FileSystemInfo info          = null;
        ulong          directorySize = 0L;

        if (flag)
        {
            info          = new DirectoryInfo(fileOrDirPath);
            directorySize = FileHelper.GetDirectorySize(fileOrDirPath);
        }
        else
        {
            info          = new FileInfo(fileOrDirPath);
            directorySize = (ulong)((FileInfo)info).Length;
        }
        string fullName = info.FullName;

        this.fblKqUhvkd.imethod_5(accepterID, fullName, flag, directorySize, info.LastWriteTime, projectID, paras, comment);
        BeginSendFileContract body       = new BeginSendFileContract(fullName, flag, directorySize, info.LastWriteTime, comment, projectID);
        IMessageHandler       interface2 = this.interface9_0.imethod_4 <BeginSendFileContract>(this.string_0, this.fileMessageTypeRoom_0.BeginSendFile, body, accepterID);

        this.SendMessage(interface2, false);
    }
Ejemplo n.º 3
0
    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);
    }