Esempio n. 1
0
        internal FtpFileTransferer(FtpDirectory transferStarter, string localFile, string remoteFile, long totalBytes, TransferDirection dir)
        {
            m_transferStarter   = transferStarter;
            m_transferDirection = dir;
            m_session           = transferStarter.FtpSession;
            m_localFile         = localFile;
            m_remoteFile        = remoteFile;
            m_totalBytes        = totalBytes;

            if (dir == TransferDirection.Upload)
            {
                m_beginEvent            = new FileEventDelegate(m_session.Host.RaiseBeginPutFileEvent);
                m_endEvent              = new FileEventDelegate(m_session.Host.RaiseEndPutFile);
                m_streamCopyRoutine     = new StreamCopyDelegate(LocalToRemote);
                m_ftpFileCommandRoutine = new FtpDelegate(m_session.ControlChannel.STOR);
                m_localFileOpenMode     = FileMode.Open;
            }
            else
            {
                m_beginEvent            = new FileEventDelegate(m_session.Host.RaiseBeginGetFileEvent);
                m_endEvent              = new FileEventDelegate(m_session.Host.RaiseEndGetFile);
                m_streamCopyRoutine     = new StreamCopyDelegate(RemoteToLocal);
                m_ftpFileCommandRoutine = new FtpDelegate(m_session.ControlChannel.RETR);
                m_localFileOpenMode     = FileMode.Create;
            }
        }
Esempio n. 2
0
        internal FtpFileTransferer(FtpDirectory transferStarter, string localFile, string remoteFile, long totalBytes, TransferDirection dir)
        {
            TransferDirection = dir;
            m_session         = transferStarter.Session;
            LocalFileName     = localFile;
            RemoteFileName    = remoteFile;
            TotalBytes        = totalBytes;

            if (dir == TransferDirection.Upload)
            {
                m_streamCopyRoutine     = LocalToRemote;
                m_ftpFileCommandRoutine = m_session.ControlChannel.STOR;
            }
            else
            {
                m_streamCopyRoutine     = RemoteToLocal;
                m_ftpFileCommandRoutine = m_session.ControlChannel.RETR;
            }
        }
Esempio n. 3
0
        internal FtpFileTransferer(FtpDirectory transferStarter, string localFile, string remoteFile, long totalBytes, TransferDirection dir)
        {
            m_transferStarter = transferStarter;
            m_transferDirection = dir;
            m_session = transferStarter.Session;
            m_localFile = localFile;
            m_remoteFile = remoteFile;
            m_totalBytes = totalBytes;

            if (dir == TransferDirection.Upload)
            {
                m_streamCopyRoutine = LocalToRemote;
                m_ftpFileCommandRoutine = m_session.ControlChannel.STOR;
                m_localFileOpenMode = FileMode.Open;
            }
            else
            {
                m_streamCopyRoutine = RemoteToLocal;
                m_ftpFileCommandRoutine = m_session.ControlChannel.RETR;
                m_localFileOpenMode = FileMode.Create;
            }
        }
        internal FtpFileTransferer(FtpDirectory transferStarter, string localFile, string remoteFile, long totalBytes, TransferDirection dir)
        {
            m_transferStarter = transferStarter;
            m_transferDirection = dir;
            m_session = transferStarter.FtpSession;
            m_localFile = localFile;
            m_remoteFile = remoteFile;
            m_totalBytes = totalBytes;

            if (dir == TransferDirection.Upload)
            {
                m_beginEvent = new FileEventDelegate(m_session.Host.RaiseBeginPutFileEvent);
                m_endEvent = new FileEventDelegate(m_session.Host.RaiseEndPutFile);
                m_streamCopyRoutine = new StreamCopyDelegate(LocalToRemote);
                m_ftpFileCommandRoutine = new FtpDelegate(m_session.ControlChannel.STOR);
                m_localFileOpenMode = FileMode.Open;
            }
            else
            {
                m_beginEvent = new FileEventDelegate(m_session.Host.RaiseBeginGetFileEvent);
                m_endEvent = new FileEventDelegate(m_session.Host.RaiseEndGetFile);
                m_streamCopyRoutine = new StreamCopyDelegate(RemoteToLocal);
                m_ftpFileCommandRoutine = new FtpDelegate(m_session.ControlChannel.RETR);
                m_localFileOpenMode = FileMode.Create;
            }
        }