/// <summary> /// Initializes a new instance of <see cref="TextReaderWriterConsole" /> class. /// </summary> /// <param name="reader">The reader to use.</param> /// <param name="writerProvider">The logic to provides the <see cref="TextWriter" /> for write operations.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="reader" /> and/or <paramref name="writerProvider" /> are <see langword="null" />. /// </exception> public TextReaderWriterConsole(TextReader reader, TextWriterProvider writerProvider) : this(reader, writerProvider, (ClearCallback)null) { }
/// <summary> /// Initializes a new instance of <see cref="TextReaderWriterConsole" /> class. /// </summary> /// <param name="reader">The reader to use.</param> /// <param name="writerProvider">The logic to provides the <see cref="TextWriter" /> for write operations.</param> /// <param name="clearCallback">The optional logic for <see cref="TextReaderWriterConsole.OnClear()" /> method.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="reader" /> and/or <paramref name="writerProvider" /> are <see langword="null" />. /// </exception> public TextReaderWriterConsole(TextReader reader, TextWriterProvider writerProvider, ClearCallback clearCallback) : this(reader, writerProvider, (TextWriterUsedCallback)null, clearCallback) { }
/// <summary> /// Initializes a new instance of <see cref="TextReaderWriterConsole" /> class. /// </summary> /// <param name="readerProvider">The logic to provides the <see cref="TextReader" /> for read operations.</param> /// <param name="readerUsedCallback"> /// The optional logic that is invoked AFTER provided <see cref="TextReader" /> has been used. /// </param> /// <param name="writerProvider">The logic to provides the <see cref="TextWriter" /> for write operations.</param> /// <param name="writerUsedCallback"> /// The optional logic that is invoked AFTER provided <see cref="TextWriter" /> has been used. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="readerProvider" /> and/or <paramref name="writerProvider" /> are <see langword="null" />. /// </exception> public TextReaderWriterConsole(TextReaderProvider readerProvider, TextReaderUsedCallback readerUsedCallback, TextWriterProvider writerProvider, TextWriterUsedCallback writerUsedCallback) : this(readerProvider, readerUsedCallback, writerProvider, writerUsedCallback, (ClearCallback)null) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <param name="isThreadSafe">Logger should be thread safe or not.</param> /// <param name="syncRoot">The unique object for thread safe operations.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> and/or <paramref name="syncRoot" /> are <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer, bool isThreadSafe, object syncRoot) : base(isThreadSafe, syncRoot) { if (provider == null) { throw new ArgumentNullException("provider"); } this._DISPOSER = disposer; this._PROVIDER = provider; }
/// <summary> /// Initializes a new instance of <see cref="TextReaderWriterConsole" /> class. /// </summary> /// <param name="readerProvider">The logic to provides the <see cref="TextReader" /> for read operations.</param> /// <param name="readerUsedCallback"> /// The optional logic that is invoked AFTER provided <see cref="TextReader" /> has been used. /// </param> /// <param name="writerProvider">The logic to provides the <see cref="TextWriter" /> for write operations.</param> /// <param name="writerUsedCallback"> /// The optional logic that is invoked AFTER provided <see cref="TextWriter" /> has been used. /// </param> /// <param name="clearCallback">The optional logic for <see cref="TextReaderWriterConsole.OnClear()" /> method.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="readerProvider" /> and/or <paramref name="writerProvider" /> are <see langword="null" />. /// </exception> public TextReaderWriterConsole(TextReaderProvider readerProvider, TextReaderUsedCallback readerUsedCallback, TextWriterProvider writerProvider, TextWriterUsedCallback writerUsedCallback, ClearCallback clearCallback) { if (readerProvider == null) { throw new ArgumentNullException("readerProvider"); } if (writerProvider == null) { throw new ArgumentNullException("writerProvider"); } this._READER_PROVIDER = readerProvider; this._READER_USED_CALLBACK = readerUsedCallback; this._WRITER_PROVIDER = writerProvider; this._WRITER_USED_CALLBACK = writerUsedCallback; this._CLEAR_CALLBACK = clearCallback; }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> is <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer) : this(provider, disposer, true) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <param name="isThreadSafe">Logger should be thread safe or not.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> is <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer, bool isThreadSafe) : this(provider, disposer, isThreadSafe, new object()) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="disposer">The optional disposer for the instance of the result of <paramref name="provider" />.</param> /// <param name="syncRoot">The unique object for thread safe operations.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> and/or <paramref name="syncRoot" /> are <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, TextWriterAction disposer, object syncRoot) : this(provider, disposer, true, syncRoot) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="isThreadSafe">Logger should be thread safe or not.</param> /// <param name="syncRoot">The unique object for thread safe operations.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> and/or <paramref name="syncRoot" /> are <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, bool isThreadSafe, object syncRoot) : this(provider, null, isThreadSafe, syncRoot) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> is <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider) : this(provider, (TextWriterAction)null) { }
/// <summary> /// Initializes a new instance of the <see cref="TextWriterLogger{W}" /> class. /// </summary> /// <param name="provider">The function that returns the <see cref="TextWriter" /> instance that should be used for logging operation.</param> /// <param name="syncRoot">The unique object for thread safe operations.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider" /> and/or <paramref name="syncRoot" /> are <see langword="null" />. /// </exception> public TextWriterLogger(TextWriterProvider provider, object syncRoot) : this(provider, true, syncRoot) { }