Beispiel #1
0
 public FTPStatusEventArgs(FTPStatusEventArgs e, string msg, string printMsg)
 {
     status          = e.Status;
     this.receiverId = e.ReeceiverId;
     this.msg        = msg;
     this.printMsg   = printMsg;
 }
        protected virtual void ProcessOnFTPConnectionError(object sender, FTPStatusEventArgs e)
        {
            FtpClientManager ftpManager;

            try
            {
                lock (ftpManagersLock)
                {
                    if (ftpManagers.ContainsKey(e.Status.Key))
                    {
                        ftpManager = ftpManagers[e.Status.Key];
                    }
                    else
                    {
                        throw new Exception(string.Format("해당 키[{0}]로 지정된 ftp코넥션이 없음", e.Status.Key));
                    }
                    ftpManager.ForceClose();
                    ftpManagers.Remove(e.Status.Key);
                    OnFTPConnectionError(e);
                }
            }
            catch (Exception ex)
            {
                Logger.error(ex.ToString());
                ErrorRaise(ex);
            }
        }
Beispiel #3
0
 public FTPStatusEventArgs(FTPStatusEventArgs e, string msg, string printMsg, int index)
 {
     status             = e.Status;
     this.receiverId    = e.ReeceiverId;
     this.msg           = msg;
     this.printMsg      = printMsg;
     this.progressIndex = index;
 }
Beispiel #4
0
        public void OnFTPReceivingFailed(FTPStatusEventArgs e)
        {
            EventHandler <FTPStatusEventArgs> handler = FTPReceivingFailed;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        public void OnFTPConnectionError(FTPStatusEventArgs e)
        {
            EventHandler <FTPStatusEventArgs> handler = FTPConnectionError;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        public void OnFTPSendingCanceled(FTPStatusEventArgs e)
        {
            EventHandler <FTPStatusEventArgs> handler = FTPSendingCanceled;

            if (handler != null)
            {
                handler(this, e);
            }
        }
 private void ProcessOnFTPStatusChanged(object sender, FTPStatusEventArgs e)
 {
     if (e.Status.Status == SocHandlerStatus.FTP_SENDING)
     {
         int    index    = (int)(e.Status.FileSizeDone * (long)100 / e.Status.FileSize);
         string msg      = "전송중(" + index + " %)";
         string printMsg = "전송중(" + index + " %)";
         Logger.info("ProcessOnFTPStatusChanged: msg=" + msg);
         OnFTPSendingProgressed(new FTPStatusEventArgs(e, msg, printMsg, index));
     }
     else if (e.Status.Status == SocHandlerStatus.FTP_END)
     {
         string msg      = "전송완료";
         string printMsg = string.Format("파일 전송이 완료되었습니다.({0})", e.Status.FileName);
         Logger.info("ProcessOnFTPStatusChanged: msg=" + msg);
         OnFTPSendingFinished(new FTPStatusEventArgs(e, msg, printMsg));
     }
     else if (e.Status.Status == SocHandlerStatus.FTP_CANCELED)
     {
         string msg      = "전송취소";
         string printMsg = string.Format("파일 전송이 취소되었습니다.({0})", e.Status.FileName);
         Logger.info("ProcessOnFTPStatusChanged: msg=" + msg);
         OnFTPSendingCanceled(new FTPStatusEventArgs(e, msg, printMsg));
     }
     else if (e.Status.Status == SocHandlerStatus.FTP_SERVER_CANCELED)
     {
         string msg      = "전송취소";
         string printMsg = string.Format("수신자가 파일 파일수신을 취소되었습니다.({0})", e.Status.FileName);
         Logger.info("ProcessOnFTPStatusChanged: msg=" + msg);
         OnFTPSendingCanceled(new FTPStatusEventArgs(e, msg, printMsg));
     }
     else if (e.Status.Status == SocHandlerStatus.ERROR)
     {
         string msg      = "전송실패";
         string printMsg = string.Format("파일 전송이 실패하였습니다.({0})", e.Status.FileName);
         Logger.info("ProcessOnFTPStatusChanged: msg=" + msg);
         OnFTPSendingFailed(new FTPStatusEventArgs(e, msg, printMsg));
     }
 }