protected virtual void OnNewMessageArrived(NewMessageEventArg e) { if (NewMessageArrived != null) { NewMessageArrived(this, e); } }
void client_NewMessageArrivedHandler(object sender, NewMessageEventArg e) { string log = string.Format("{0} {1}", DateTime.Now, e.NewMessage); this.lstLog.Items.Add(log); this.lstLog.SelectedIndex = this.lstLog.Items.Count - 1; }
/// <summary> /// 记录FTPClient信息 /// </summary> void client_NewMessageArrived(object sender, NewMessageEventArg e) { string log = string.Format("{0} {1}", DateTime.Now, e.NewMessage); this.lstLog.Items.Add(log); this.lstLog.SelectedIndex = this.lstLog.Items.Count - 1; }
/// <summary> /// Log the message of FTPClient. /// </summary> void client_NewMessageArrived(object sender, NewMessageEventArg e) { this.Invoke(new EventHandler <NewMessageEventArg>( client_NewMessageArrivedHandler), sender, e); }