Esempio n. 1
0
        public void MessageNotify(string msg)
        {
            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.Message = msg;
            m_ftpcom.OnMessage(e);
        }
Esempio n. 2
0
        public void CommandNotify(string msg)
        {
            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.Message = msg.Substring(0, msg.Length - 2);
            m_ftpcom.OnFTPCommand(e);
        }
Esempio n. 3
0
        public void LoginCompleted()
        {
            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.Message = "";
            m_ftpcom.OnLogged(e);
        }
Esempio n. 4
0
        public void TransferCompleted(int BytesTransfered, int TimeElapsed)
        {
            string s;

            s = m_dataSock.Response;

            m_dataSock.Disconnect();

            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.TotalBytes  = BytesTransfered;
            e.TimeElapsed = TimeElapsed;
            e.Message     = s;
            if (m_dataSock.DataCommande == 0)
            {
                m_ftpcom.OnDirCompleted(e);
            }
            else if (m_dataSock.DataCommande == 1)
            {
                m_ftpcom.OnFileDownloadCompleted(e);
            }
            else
            {
                m_ftpcom.OnFileUploadCompleted(e);
            }

            m_dataSock = null;
        }
Esempio n. 5
0
        private void ftpc_FileUploadCompleted(object sender, FTPCom.FTPEventArgs e)
        {
            string msg = "Transfered " + e.TotalBytes.ToString() + " bytes in " + ((float)e.TimeElapsed / 1000).ToString() + " seconds" + CRLF;

            TextLog.SelectionColor = Color.Black;
            TextLog.AppendText(msg);
            ftpc.Dir();
        }
Esempio n. 6
0
        public void LoginFailure()
        {
            CancelCommand();
            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.Message = "";
            m_ftpcom.OnLoginFailure(e);
        }
Esempio n. 7
0
        public void PourcentDownload(int bytestransfered, int totalbytes)
        {
            string msg = bytestransfered.ToString() + CRLF;

            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.Message = msg;
            m_ftpcom.OnMessage(e);
        }
Esempio n. 8
0
 private void ftpc_Message(object sender, FTPCom.FTPEventArgs e)
 {
     TextLog.SelectionColor = Color.Green;
     if (e.Message != string.Empty)
     {
         TextLog.AppendText(e.Message);
     }
     TextLog.AppendText(Environment.NewLine);
 }
Esempio n. 9
0
        public void ConnectionCompleted()
        {
            FTPEventArgs e = new FTPCom.FTPEventArgs();
            e.Message = "";
            m_ftpcom.OnConnected(e);

            // The connection is succeeded
            m_bConnected = true;
            ProceedNextCommand();
        }
Esempio n. 10
0
        public void ErrorNotify(string msg, string functionName)
        {
            CancelCommand();

            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.Message      = msg;
            e.FunctionName = functionName;
            m_ftpcom.OnError(e);
        }
Esempio n. 11
0
 private void ftpc_Error(object sender, FTPCom.FTPEventArgs e)
 {
     TextLog.SelectionColor = Color.Red;
     TextLog.AppendText(e.FunctionName);
     TextLog.AppendText("-");
     if (e.Message != string.Empty)
     {
         TextLog.AppendText(e.Message);
     }
 }
Esempio n. 12
0
        public void ConnectionCompleted()
        {
            FTPEventArgs e = new FTPCom.FTPEventArgs();

            e.Message = "";
            m_ftpcom.OnConnected(e);

            // The connection is succeeded
            m_bConnected = true;
            ProceedNextCommand();
        }
Esempio n. 13
0
 private void ftpc_FTPCommand(object sender, FTPCom.FTPEventArgs e)
 {
     TextLog.SelectionColor = Color.Blue;
     if (e.Message != string.Empty)
     {
         TextLog.AppendText(e.Message);
     }
     TextLog.AppendText("\n");
     TextLog.SelectionStart = TextLog.TextLength;
     TextLog.ScrollToCaret();
 }
Esempio n. 14
0
        private void ftpc_DirCompleted(object sender, FTPCom.FTPEventArgs e)
        {
            int    i       = 0;
            int    idimage = 0;
            string msg;

            msg = "Transfered " + e.TotalBytes.ToString() + " bytes in " + ((float)e.TimeElapsed / 1000).ToString() + " seconds" + CRLF;
            TextLog.SelectionColor = Color.Black;
            TextLog.AppendText(msg);

            ServerView.BeginUpdate();
            ServerView.Items.Clear();
            ImgListServerSmall.Images.Clear();

            ListViewItem lvItem = new ListViewItem("..");

            ServerView.Items.Add(lvItem);

            for (i = 0; i < ftpc.FileCount; i++)
            {
                if (ftpc.IsFolder(i))
                {
                    string[] items = new String[2];
                    items[0] = ftpc.GetFileName(i);
                    items[1] = ftpc.GetFileSize(i).ToString();
                    ImgListServerSmall.Images.Add(m_IconFolder);
                    ServerView.Items.Add(new ListViewItem(items, idimage++));
                }
            }
            for (i = 0; i < ftpc.FileCount; i++)
            {
                if (!ftpc.IsFolder(i))
                {
                    string[] items = new String[2];
                    items[0] = ftpc.GetFileName(i);
                    items[1] = ftpc.GetFileSize(i).ToString();
                    ImgListServerSmall.Images.Add(ExtractIcon.GetIcon(items[0], false));
                    ServerView.Items.Add(new ListViewItem(items, idimage++));
                }
            }
            ServerView.EndUpdate();
            this.Cursor = Cursors.Default;
        }
Esempio n. 15
0
 public void LoginCompleted()
 {
     FTPEventArgs e = new FTPCom.FTPEventArgs();
     e.Message = "";
     m_ftpcom.OnLogged(e);
 }
Esempio n. 16
0
        public void ErrorNotify(string msg, string functionName)
        {
            CancelCommand();

            FTPEventArgs e = new FTPCom.FTPEventArgs();
            e.Message = msg;
            e.FunctionName = functionName;
            m_ftpcom.OnError(e);
        }
Esempio n. 17
0
 public void CommandNotify(string msg)
 {
     FTPEventArgs e = new FTPCom.FTPEventArgs();
     e.Message = msg.Substring(0, msg.Length -2);
     m_ftpcom.OnFTPCommand(e);
 }
Esempio n. 18
0
        public void TransferCompleted(int BytesTransfered, int TimeElapsed)
        {
            string s;

            s = m_dataSock.Response;

            m_dataSock.Disconnect();

            FTPEventArgs e = new FTPCom.FTPEventArgs();
            e.TotalBytes = BytesTransfered;
            e.TimeElapsed = TimeElapsed;
            e.Message = s;
            if (m_dataSock.DataCommande == 0)
                m_ftpcom.OnDirCompleted(e);
            else if (m_dataSock.DataCommande == 1)
                m_ftpcom.OnFileDownloadCompleted(e);
            else
                m_ftpcom.OnFileUploadCompleted(e);

            m_dataSock = null;
        }
Esempio n. 19
0
        public void PourcentDownload(int bytestransfered, int totalbytes)
        {
            string msg = bytestransfered.ToString() + CRLF;

            FTPEventArgs e = new FTPCom.FTPEventArgs();
            e.Message = msg;
            m_ftpcom.OnMessage(e);
        }
Esempio n. 20
0
 public void MessageNotify(string msg)
 {
     FTPEventArgs e = new FTPCom.FTPEventArgs();
     e.Message = msg;
     m_ftpcom.OnMessage(e);
 }
Esempio n. 21
0
 public void LoginFailure()
 {
     CancelCommand();
     FTPEventArgs e = new FTPCom.FTPEventArgs();
     e.Message = "";
     m_ftpcom.OnLoginFailure(e);
 }
Esempio n. 22
0
 private void ftpc_Logged(object sender, FTPCom.FTPEventArgs e)
 {
     ftpc.Dir();
 }
Esempio n. 23
0
 private void ftpc_Connected(object sender, FTPCom.FTPEventArgs e)
 {
     ftpc.Login();
 }
Esempio n. 24
0
 public void ftpc_ConnectionTerminated(object sender, FTPCom.FTPEventArgs e)
 {
 }