Example #1
0
        public void Dispose()
        {
            try
            {
                this.handleAutotrain(false);

                /*
                 * if ((this.thread_spam != null) && (this.thread_spam.IsAlive))
                 * {
                 *  this.thread_spam.Abort();
                 *  this.thread_spam = null;
                 * }
                 *
                 * if ((this.thread_ham != null) && (this.thread_ham.IsAlive))
                 * {
                 *  this.thread_ham.Abort();
                 *  this.thread_ham = null;
                 * }
                 */

                if (this.wrapper != null)
                {
                    this.wrapper.Uninitialize();
                    this.wrapper = null;
                }

                if (this.ns != null)
                {
                    this.ns.Logoff();
                    this.ns = null;
                }
            }
            catch (Exception ex)
            {
                this.logger.WriteError("MailParser.Dispose() " + ex.Message);
                this.logger.WriteError(ex.StackTrace);
            }
        }
Example #2
0
        /*
        private Queue queue_spam = null;
        private Queue queue_ham = null;

        private Thread thread_spam = null;
        private Thread thread_ham = null;
        */
        public MailParser(Logger log, Outlook.Application objOutlook, Worker w)
        {
            this.logger = log;
            this.outlook = objOutlook;

            this.ns = this.outlook.GetNamespace("MAPI");
            this.ns.Logon(Missing.Value, Missing.Value, false, false);

            this.wrapper = new MAPIPropWrapper();
            this.wrapper.Initialize();

            this.worker = w;

            /*
            this.queue_spam = new Queue();
            this.queue_ham = new Queue();

            this.thread_spam = new Thread(new ThreadStart(this.handleSpam));
            // this.thread_spam.Start();

            this.thread_ham = new Thread(new ThreadStart(this.handleHam));
            // this.thread_ham.Start();
            */
        }
Example #3
0
        /*
         * private Queue queue_spam = null;
         * private Queue queue_ham = null;
         *
         * private Thread thread_spam = null;
         * private Thread thread_ham = null;
         */
        public MailParser(Logger log, Outlook.Application objOutlook, Worker w)
        {
            this.logger  = log;
            this.outlook = objOutlook;

            this.ns = this.outlook.GetNamespace("MAPI");
            this.ns.Logon(Missing.Value, Missing.Value, false, false);

            this.wrapper = new MAPIPropWrapper();
            this.wrapper.Initialize();

            this.worker = w;

            /*
             * this.queue_spam = new Queue();
             * this.queue_ham = new Queue();
             *
             * this.thread_spam = new Thread(new ThreadStart(this.handleSpam));
             * // this.thread_spam.Start();
             *
             * this.thread_ham = new Thread(new ThreadStart(this.handleHam));
             * // this.thread_ham.Start();
             */
        }
Example #4
0
        public void Dispose()
        {
            try
            {
                this.handleAutotrain(false);

                /*
                if ((this.thread_spam != null) && (this.thread_spam.IsAlive))
                {
                    this.thread_spam.Abort();
                    this.thread_spam = null;
                }

                if ((this.thread_ham != null) && (this.thread_ham.IsAlive))
                {
                    this.thread_ham.Abort();
                    this.thread_ham = null;
                }
                */

                if (this.wrapper != null)
                {
                    this.wrapper.Uninitialize();
                    this.wrapper = null;
                }

                if (this.ns != null)
                {
                    this.ns.Logoff();
                    this.ns = null;
                }
            }
            catch (Exception ex)
            {
                this.logger.WriteError("MailParser.Dispose() " + ex.Message);
                this.logger.WriteError(ex.StackTrace);
            }
        }