public void Initialize() { labelMainMessage.Text = string.Format("{0}[{1}]님이 파일을 보내려고 합니다.\n파일을 저장하시겠습니까?", Members.GetByUserId(rcvObj.SenderId).Name, rcvObj.SenderId); //TextBoxSaveDir.Text = string.Format(WeDoCommon.ConstDef.MSGR_DATA_FILE_DIR,ConfigHelper.Id); TextBoxSaveDir.Text = Environment.GetFolderPath(Environment.SpecialFolder.Personal); SetValidFileName(TextBoxSaveDir.Text); ToolTipFileName.SetToolTip(LabelFileName, realDownloadedFileName); ToolTipFileName.Active = true; PanelFinishFileSave.Visible = false; setProgressVisible(false); DownloadForms.AddForm(formKey, this); connection.FTPReadyToListen += ProcessOnFTPReadyToListen; connection.FTPReceivingProgressed += ProcessOnFTPReceivingProgressed; connection.FTPReceivingFinished += ProcessOnFTPReceivingFinished; connection.FTPReceivingCanceled += ProcessOnFTPReceivingCanceled; connection.FTPReceivingFailed += ProcessOnFTPReceivingFailed; closeOnNoResponseTimer.Interval = 30000; //타임아웃을 30초로 설정하고 타임아웃인 경우 화면을 닫는다. closeOnNoResponseTimer.Tick += new EventHandler(CheckDownloadFileTimeOutOnTick); //connection.FTP }
private void DownloadForm_FormClosed(object sender, FormClosedEventArgs e) { DownloadForms.RemoveForm(formKey); connection.FTPReadyToListen -= ProcessOnFTPReadyToListen; connection.FTPReceivingProgressed -= ProcessOnFTPReceivingProgressed; connection.FTPReceivingFinished -= ProcessOnFTPReceivingFinished; connection.FTPReceivingCanceled -= ProcessOnFTPReceivingCanceled; connection.FTPReceivingFailed -= ProcessOnFTPReceivingFailed; }
/// <summary> /// FTP수신자: 파일수신오류 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ProcessOnFTPReceivingFailed(object sender, FTPStatusEventArgs e) { try { if (DownloadForms.Contain(e.Status.Key)) { OnFTPReceivingFailed(e); } else { Logger.info(string.Format("에러 : DownloadForms 해당화면없음.Status.Key[{0}]", e.Status.Key)); } } catch (Exception ex) { Logger.error(ex.ToString()); } }
/// <summary> /// 열린 창 닫기 /// 로그아웃 전에 열린 폼 닫기 및 정보테이블 삭제 /// </summary> public void DisposeFormsOnLogOut() { //자원해제 대상 try { if (noticelistform != null && !noticelistform.IsDisposed) { noticelistform.Close(); noticelistform.Dispose(); } if (noticeresultform != null && !noticeresultform.IsDisposed) { noticeresultform.Close(); noticeresultform.Dispose(); } if (noreceiveboardform != null && !noreceiveboardform.IsDisposed) { noreceiveboardform.Close(); noreceiveboardform.Dispose(); } if (mMemoListForm != null && !mMemoListForm.IsDisposed) { mMemoListForm.Close(); mMemoListForm.Dispose(); } ChatForms.Dispose(); SendMemoForms.Dispose(); Members.ClearAll(); FileSendDetailListViews.Dispose(); SendFileForms.Dispose(); DownloadForms.Dispose(); NoticeDetailForms.Dispose(); MemoForms.Dispose(); } catch (Exception e) { Logger.error(e.ToString()); } }