public virtual void OnSocStatusChangedOnInfo(SocStatusEventArgs e) { if (Logger.level >= LOGLEVEL.INFO) { OnSocStatusChanged(e); } }
public virtual void OnSocStatusChangedOnDebug(SocStatusEventArgs e) { if (Logger.level >= LOGLEVEL.DEBUG) { OnSocStatusChanged(e); } }
public virtual void OnSocStatusChangedOnError(SocStatusEventArgs e) { if (Logger.level >= LOGLEVEL.ERROR) { OnSocStatusChanged(e); } }
protected override void ServerMgrStatusChanged(object sender, SocStatusEventArgs e) { if (e.Status.Cmd == MsgDef.MSG_BYE) { Stop(); } base.OnSocStatusChanged(e); }
protected void FTP_StatusChanged(object sender, SocStatusEventArgs e) { //if (e.Status.Cmd == MsgDef.MSG_BYE) //{ // server. //} base.OnSocStatusChanged(e); }
public virtual void OnSocStatusChanged(SocStatusEventArgs e) { EventHandler<SocStatusEventArgs> handler = SocStatusChanged; if (handler != null) { handler(this, e); } }
public virtual void OnSocStatusChanged(SocStatusEventArgs e) { EventHandler <SocStatusEventArgs> handler = SocStatusChanged; if (handler != null) { handler(this, e); } }
public virtual void OnSocStatusChanged(SocStatusEventArgs e) { EventHandler <SocStatusEventArgs> handler = SocStatusChanged; if (handler != null) { //Logger.WriteLine("ServerManager.OnSocStatusChanged"); handler(this, e); } }
public override void OnSocStatusChanged(SocStatusEventArgs e) { if (e.Status.status == SocHandlerStatus.CONNECTED || e.Status.status == SocHandlerStatus.DISCONNECTED) { Initialize(); } if (e.Status.status == SocHandlerStatus.ERROR) { if (!closedOnError) { closedOnError = true; closeFTPConnection(e.Status); } } base.OnSocStatusChanged(e); }
private void UpdateButtonSendingText(object sender, SocStatusEventArgs e) { if (this.ButtonFileSend.InvokeRequired) { SetThreadSocMsgButtonCallback d = new SetThreadSocMsgButtonCallback(UpdateButtonSendingText); this.Invoke(d, new object[] { sender, e }); } else { ButtonFileSend.Text = "��������"; mIsSending = false; FTP_END(); } }
private void SocStatusChanged(object sender, SocStatusEventArgs e) { UpdateMsgStatus(sender, e); if (e.Status.status == SocHandlerStatus.FTP_SENDING) { UpdateFTPStatus(sender, e); } else if (e.Status.status == SocHandlerStatus.FTP_END || e.Status.status == SocHandlerStatus.FTP_CANCELED || e.Status.status == SocHandlerStatus.FTP_SERVER_CANCELED) { UpdateButtonSendingText(sender, e); } AppendConsoleMsg(sender, e, ""); }
private void AppendConsoleMsg(object sender, SocStatusEventArgs e, string msg) { if (this.RichTextBoxLog.InvokeRequired) { SetThreadSocMsgConsoleCallback d = new SetThreadSocMsgConsoleCallback(AppendConsoleMsg); this.Invoke(d, new object[] { sender, e, msg }); } else { if (e.Status.socMessage != null && e.Status.socMessage.Trim() != "") RichTextBoxLog.AppendText(">" + e.Status.socMessage + "\n"); if (msg != null && msg.Trim() != "") RichTextBoxLog.AppendText(">" + msg + "\n"); if (e.Status.exception != null) { if (e.Status.exception is SocketException) RichTextBoxLog.AppendText(string.Format(">Error: {0} : {1}", ((SocketException)e.Status.exception).ErrorCode, ((SocketException)e.Status.exception).Message)); else RichTextBoxLog.AppendText(string.Format(">Error: {0}", e.Status.exception.Message)); } RichTextBoxLog.ScrollToCaret(); } }
private void FTP_SndStatusChanged(object sender, SocStatusEventArgs e) { try { StateObject stateObject = e.Status; if (FileSendFormList.Count != 0 && FileSendFormList[stateObject.key] != null) { SendFileForm sendFileForm = (SendFileForm)FileSendFormList[stateObject.key]; FileSendDetailListView fileSendDetailList = (FileSendDetailListView)FileSendDetailList[stateObject.key]; logWrite("CHOI_DEBUG e.Status.status == SocHandlerStatus.ERROR"); switch (e.Status.status) { case SocHandlerStatus.FTP_SENDING: int transRate = (int)(stateObject.fileSizeDone * (long)100 / stateObject.FileSize); logWrite("전송중(" + transRate + " %)"); Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.SENDING, "전송중(" + transRate + " %)", transRate, sendFileForm }); Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송중(" + transRate + " %)", fileSendDetailList }); break; case SocHandlerStatus.FTP_END: logWrite("파일전송완료"); Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.SUCCESS, "전송완료", -1, sendFileForm }); Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송완료", fileSendDetailList }); break; case SocHandlerStatus.FTP_SERVER_CANCELED: case SocHandlerStatus.FTP_CANCELED: logWrite("파일전송취소"); Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.CANCELED, "전송취소", -1, sendFileForm }); Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송취소", fileSendDetailList }); break; case SocHandlerStatus.ERROR: logWrite("파일전송실패"); Invoke(showFileSendStatExDelegate, new object[] { DownloadStatus.FAILED, "전송실패", -1, sendFileForm }); Invoke(showFileSendDetailDelegate, new object[] { mRcvId, "전송실패", fileSendDetailList }); break; } } else { logWrite(string.Format("에러 : FileSendFormList" + "해당화면없음.")); } } catch (Exception ex) { logWrite(ex.ToString()); } //AppendConsoleMsg(sender, e, ""); //sendfilesize = (sendfilesize - 40960.0); //total += percent; //if (total >= 100.0) total = 100.0; //string[] totalArray = (total.ToString()).Split('.'); //if (!iep.Address.ToString().Equals(serverIP)) //{ // if (FileSendFormList.Count != 0 && FileSendFormList[formKey] != null) // { // Invoke(showFileSendStatDelegate, new object[] { "전송중(" + totalArray[0] + " %)", form }); // } // if (FileSendDetailList.Count != 0 && FileSendDetailList[formKey] != null) // { // string detailmsg = "전송중(" + totalArray[0] + " %)"; // Invoke(showFileSendDetailDelegate, new object[] { rcvId, detailmsg, view }); // } //} }
private void RichTextBoxLogChanged(object sender, SocStatusEventArgs e, string strStatus) { if (this.RichTextBoxLog.InvokeRequired) { CallbackRichTextBoxLog d = new CallbackRichTextBoxLog(RichTextBoxLogChanged); this.Invoke(d, new object[] { sender, e, strStatus }); } else { this.RichTextBoxLog.AppendText(">" + strStatus + ":" + e.Status.socMessage + "\n"); if (e.Status.exception != null) { if (e.Status.exception is SocketException) RichTextBoxLog.AppendText(string.Format(">Error: {0} : {1}", ((SocketException)e.Status.exception).ErrorCode, ((SocketException)e.Status.exception).Message) + "\n"); else { this.RichTextBoxLog.AppendText(string.Format(">Error: {0}", e.Status.exception.Message) + "\n"); } } this.RichTextBoxLog.ScrollToCaret(); } }
protected override void TcpClientStatusChanged(object sender, SocStatusEventArgs e) { base.OnSocStatusChanged(e); }
private void ProgressBarFileEnd(object sender, SocStatusEventArgs e) { if (this.ProgressBarFileReceiving.InvokeRequired) { CallbackProgressBarFileEnd d = new CallbackProgressBarFileEnd(ProgressBarFileEnd); this.Invoke(d, new object[] { sender, e }); } else { this.ProgressBarFileReceiving.Visible = false; Logger.info("ProgressBarFileReceiving.Visible=" + ProgressBarFileReceiving.Visible); } }
protected virtual void TcpClientStatusChanged(object sender, SocStatusEventArgs e) { OnSocStatusChanged(e); }
public virtual void OnSocStatusChangedOnInfo(SocStatusEventArgs e) { if (Logger.level >= LOGLEVEL.INFO) OnSocStatusChanged(e); }
public virtual void OnSocStatusChangedOnError(SocStatusEventArgs e) { if (Logger.level >= LOGLEVEL.ERROR) OnSocStatusChanged(e); }
public virtual void OnSocStatusChangedOnDebug(SocStatusEventArgs e) { if (Logger.level >= LOGLEVEL.DEBUG) OnSocStatusChanged(e); }
private void SocStatusChanged(object sender, SocStatusEventArgs e) { //Logger.info("Form1.OnSocStatusChanged:"+e.Status.socMessage); string strStatus = ""; switch (e.Status.status) { case SocHandlerStatus.UNINIT: strStatus = "UNINIT"; break; case SocHandlerStatus.CONNECTED: strStatus = "CONNECTED"; break; case SocHandlerStatus.DISCONNECTED: strStatus = "DISCONNECTED"; break; case SocHandlerStatus.ERROR: strStatus = "ERROR"; break; case SocHandlerStatus.RECEIVING: strStatus = "RECEIVING"; break; case SocHandlerStatus.SENDING: strStatus = "SENDING"; break; case SocHandlerStatus.LISTENING: strStatus = "LISTENING"; break; case SocHandlerStatus.STOP: strStatus = "STOP"; break; } if (e.Status.ftpStatus == FTPStatus.RECEIVE_STREAM) { ProgressBarStatusChanged(sender, e); } if (e.Status.ftpStatus == FTPStatus.RECEIVED_FILE_INFO) { ProgressBarFileBegin(sender, e); ButtonCancelStatusChanged(sender, e); } if (e.Status.ftpStatus == FTPStatus.SENT_DONE) { ProgressBarFileEnd(sender, e); ButtonCancelStatusChanged(sender, e); } RichTextBoxLogChanged(sender, e, strStatus); TextBoxSocketStatusChanged(sender, e, strStatus); }
private void UpdateFTPStatus(object sender, SocStatusEventArgs e) { if (this.ProgressBarFileReceiving.InvokeRequired) { SetThreadSocMsgCallback d = new SetThreadSocMsgCallback(UpdateFTPStatus); this.Invoke(d, new object[] { sender, e }); } else { mCurTransferSize += e.Status.bufferSize; ProgressBarFileReceiving.Value = (int)(mCurTransferSize * (long)100 / mFileSize); } }
private void UpdateMsgStatus(object sender, SocStatusEventArgs e) { if (this.TextBoxSocketStatus.InvokeRequired) { SetThreadSocMsgLabelCallback d = new SetThreadSocMsgLabelCallback(UpdateMsgStatus); this.Invoke(d, new object[] { sender, e }); } else { string strStatus = ""; switch (e.Status.status) { case SocHandlerStatus.UNINIT: strStatus = "UNINIT"; break; case SocHandlerStatus.CONNECTED: strStatus = "CONNECTED"; break; case SocHandlerStatus.DISCONNECTED: strStatus = "DISCONNECTED"; break; case SocHandlerStatus.ERROR: strStatus = "ERROR"; break; case SocHandlerStatus.RECEIVING: strStatus = "RECEIVING"; break; case SocHandlerStatus.SENDING: strStatus = "SENDING"; break; } AddEventsLogMessage(strStatus); } }
protected virtual void ServerMgrStatusChanged(object sender, SocStatusEventArgs e) { OnSocStatusChanged(e); }
private void TextBoxSocketStatusChanged(object sender, SocStatusEventArgs e, string strStatus) { if (this.TextBoxSocketStatus.InvokeRequired) { CallbackTextBoxSocketStatus d = new CallbackTextBoxSocketStatus(TextBoxSocketStatusChanged); this.Invoke(d, new object[] { sender, e, strStatus }); } else { AddEventsLogMessage(strStatus); //UpdateListBoxSelectedItemIndicesTextBox(); } }
private void ButtonCancelStatusChanged(object sender, SocStatusEventArgs e) { if (this.ButtonStopReceiving.InvokeRequired) { CallbackCancelButtonStatus d = new CallbackCancelButtonStatus(ButtonCancelStatusChanged); this.Invoke(d, new object[] { sender, e }); } else { //ButtonStopReceiving.Enabled = !ButtonStopReceiving.Enabled; } }
public virtual void OnSocStatusChanged(SocStatusEventArgs e) { EventHandler<SocStatusEventArgs> handler = SocStatusChanged; if (handler != null) { //Logger.WriteLine("ServerManager.OnSocStatusChanged"); handler(this, e); } }
public void FTP_RcvStatusChanged(object sender, SocStatusEventArgs e) { if (e.Status.Cmd == MsgDef.MSG_BYE) { FTP_Stop(); } if (e.Status.status == SocHandlerStatus.ERROR) { logWrite("CHOI_DEBUG e.Status.status == SocHandlerStatus.ERROR"); FTP_InvokeDownloadForm(DownloadStatus.FAILED, -1, mFormKeyRcv); } else { switch (e.Status.ftpStatus) { case FTPStatus.RECEIVE_STREAM://진행 FTP_InvokeDownloadForm(DownloadStatus.RECEIVING, (int)(100 * e.Status.fileSizeDone / e.Status.FileSize), mFormKeyRcv); break; case FTPStatus.RECEIVED_FILE_INFO://시작 FTP_InvokeDownloadForm(DownloadStatus.START, -1, mFormKeyRcv); break; case FTPStatus.SENT_DONE://종료 FTP_InvokeDownloadForm(DownloadStatus.END, -1, mFormKeyRcv); break; } } }
private void ProgressBarStatusChanged(object sender, SocStatusEventArgs e) { if (this.ProgressBarFileReceiving.InvokeRequired) { CallbackProgressBarFileStream d = new CallbackProgressBarFileStream(ProgressBarStatusChanged); this.Invoke(d, new object[] { sender, e }); } else { this.ProgressBarFileReceiving.Value = (int)(100 * e.Status.fileSizeDone / e.Status.FileSize); Logger.info("ProgressBarFileReceiving.Value=" + ProgressBarFileReceiving.Value); } }