Пример #1
0
 public override void Close()
 {
     writeConOut = false;
     System.Console.SetOut(oldOut);
     oldOut = null;
     if (writer != null)
     {
         writer.Close(); writer = null;
     }
     if (mutex != null)
     {
         mutex.Close(); mutex = null;
     }
 }
Пример #2
0
 private void ConsoleLoggerInit()
 {
     if (base.BaseStream is FileStream)
     {
         string id = ((FileStream)base.BaseStream).Name.ToIdentifier();
         bool   createdNew;
         mutex = new Mutex(false, id, out createdNew);
     }
     writer = new QWriter(this);  //Asynchronous
     //writer = new SyncWriter(this); //Synchronous
     oldOut = System.Console.Out;
     System.Console.SetOut(this);
     writeConOut = true;
 }
Пример #3
0
 public ControllerBase(IReaderBase <T> reader, IWriterBase <T> writer)
 {
     this.reader = reader ?? throw new ArgumentNullException();
     this.writer = writer ?? throw new ArgumentNullException();
 }