Пример #1
0
 private void OnCommandManagerUpdateMessage(object sender, SMTP.Commands.CommandEvent.CommandEventArgs e)
 {
     MessageEventArgs mea = new MessageEventArgs(e.Message);
     mea.Type=(MessageEventType)(int)e.Type;
     this.WriteLog(sender, mea);
 }
Пример #2
0
        /////////////////////////////////GUI EVENT PROCESS END HERE/////////////////////////////////////
        //Write log to list.
        private void WriteLog(object sender, MessageEventArgs e)
        {
            string strLog = "";
            if (e.Type == MessageEventType.Log) {
                strLog += "  ";
            }
            else if (e.Type == MessageEventType.Error) {
                strLog += "!!!";
            }
            if (e.Message.Length > 255)
            {
                strLog += e.Message.Substring(0, 255);
            }
            else {
                strLog+=e.Message;
            }

            // Modified by Norman Xu 11/1/2007
            // Change Invoke to BeginInvoke.

            lstLog.BeginInvoke(new delWriteLogToItemlist(this.WriteLogToitemlist), strLog);
        }
Пример #3
0
 private void WriteLog(string _log, MessageEventType _logType)
 {
     //If user has not defined the event. do not write log.
     if (null != this.OnLogWrite)
     {
         MessageEventArgs EventMessage = new MessageEventArgs(_log);
         EventMessage.Type = _logType;
         this.OnLogWrite("nscLibrary.Utility.SMTPCommunicator", EventMessage);
     }
 }