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; } }
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; }
public ControllerBase(IReaderBase <T> reader, IWriterBase <T> writer) { this.reader = reader ?? throw new ArgumentNullException(); this.writer = writer ?? throw new ArgumentNullException(); }