Exemplo n.º 1
0
        // Methods
        private Log()
        {
            _fileLogger = new FileLogger ();
            enableLogFile = false;
            catchEx = true;

            workThread = new Thread (new ThreadStart (this.WorkFunction));
            workThread.Name = "Logger Thread";
            workThread.Priority = ThreadPriority.BelowNormal;
            workThread.Start ();

            flag = new AutoResetEvent (false);
            eventQueue = new Queue<LogEvent> ();
        }
Exemplo n.º 2
0
 private void Dispose(bool disposing)
 {
     if (disposing) {
         lock (eventQueue) {
             if (this.workThread != null) {
                 this.workThread.Abort ();
                 this.workThread.Join ();
                 this.workThread = null;
             }
             if (this.flag != null) {
                 this.flag.Close ();
                 this.flag = null;
             }
             if (_fileLogger != null) {
                 _fileLogger.Dispose (true);
                 _fileLogger = null;
             }
         }
     }
 }