protected virtual void MailboxWorkerMessageRecieved(object sender, MessageInfoEventArgs e) { lock ( synclock ) { Total++; IMimeFileWorker worker = Activator.CreateInstance <Tmime>(); worker.BeginProcessing += new MessageInfoHandler(MimeFileWorkerBeginProcessing); worker.DoneProcessing += new MessageInfoHandler(MimeFileWorkerDoneProcessing); worker.ProcessingError += new MessageInfoHandler(MimeFileWorkerProcessingError); worker.ProcessingWarning += new MessageInfoHandler(MimeFileWorkerProcessingWarning); WorkPool.QueueWorkItem <string>(x => worker.Process(ConnectInfo.PathInfo, x), e.Info); } string message = string.Format("Message {0} received. ", Path.GetFileName(e.Info)); Log(message); }
protected virtual void MailboxWorkerMessageRequested(object sender, MessageInfoEventArgs e) { string message = "Message requested: " + e.Info; Log(message); }
protected virtual void MailboxWorkerServerError(object sender, MessageInfoEventArgs e) { string message = string.Format("WARNING: Error from POP server: {0}", e.Info); Log(message, ConsoleColor.DarkYellow, ConsoleColor.Black); }
protected virtual void MailboxWorkerPreviouslyDownloaded(object sender, MessageInfoEventArgs e) { string message = string.Format("Already have {0}. Skipping.", e.Info); Log(message, ConsoleColor.Magenta, ConsoleColor.Black); }
protected virtual void MailboxWorkerMessageCountReceived(object sender, MessageInfoEventArgs e) { Log(string.Format("{0} message(s) found.\r\n", e.Info)); }
protected virtual void MimeFileWorkerBeginProcessing(object sender, MessageInfoEventArgs e) { string message = string.Format("{0} scheduled for decoding.", Path.GetFileName(e.Info)); Log(message, ConsoleColor.Cyan, ConsoleColor.Black); }
protected virtual void MimeFileWorkerDoneProcessing(object sender, MessageInfoEventArgs e) { string message = string.Format("{0} processed.", Path.GetFileName(e.Info)); Log(message, ConsoleColor.Green, ConsoleColor.Black); }
protected virtual void MimeFileWorkerProcessingError(object sender, MessageInfoEventArgs e) { string message = string.Format("ERROR: MIME processing: {0}\r\n{1}", e.Info, e.ExceptionInfo); Log(message, ConsoleColor.Red, ConsoleColor.Black); }
protected virtual void MimeFileWorkerProcessingWarning(object sender, MessageInfoEventArgs e) { string message = string.Format("WARNING: MIME processing: {0}\r\n{1}", e.Info, e.ExceptionInfo); Log(message, ConsoleColor.DarkYellow, ConsoleColor.Black); }