Class SafeTextWriterWrapper
  
  Decorates a  instance and
makes no assumptions about whether 
has been called on the inner instance or not. Acts like a circuit breaker -
the first  caught turns it off and
the rest of the calls are ignored after that point until Reset()
is called.
The primary purpose is for using a  instance within a non-disposable
parent object. Since the creator of the  ultimately is responsible for
disposing it, our non-disposable object has no way of knowing whether it is safe to use the .
Wraping the  within a SafeTextWriterWrapper ensures the
non-disposable object can continue to make calls to the  without raising
exceptions (it is presumed that the  functionality is optional).
 
  
  
    Inheritance
    System.Object
    SafeTextWriterWrapper
   
  
  Assembly: Lucene.Net.dll
  Syntax
  
    public class SafeTextWriterWrapper : TextWriter
   
  Constructors
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  SafeTextWriterWrapper(TextWriter)
  
  
  Declaration
  
    public SafeTextWriterWrapper(TextWriter textWriter)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | TextWriter | 
        textWriter | 
         | 
      
    
  
  Properties
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Encoding
  
  
  Declaration
  
    public override Encoding Encoding { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Encoding | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  FormatProvider
  
  
  Declaration
  
    public override IFormatProvider FormatProvider { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | IFormatProvider | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  NewLine
  
  
  Declaration
  
    public override string NewLine { get; set; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  Methods
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Close()
  
  
  Declaration
  
    public override void Close()
   
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Dispose(Boolean)
  
  
  Declaration
  
    protected override void Dispose(bool disposing)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Boolean | 
        disposing | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Equals(Object)
  
  
  Declaration
  
    public override bool Equals(object obj)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Object | 
        obj | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Flush()
  
  
  Declaration
  
    public override void Flush()
   
  
    |
    Improve this Doc
  
  
    View Source
  
  
  FlushAsync()
  
  
  Declaration
  
    public override Task FlushAsync()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  GetHashCode()
  
  
  Declaration
  
    public override int GetHashCode()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Int32 | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  InitializeLifetimeService()
  
  
  Declaration
  
    public override object InitializeLifetimeService()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Object | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Reset()
  
  
  Declaration
  
    public virtual void Reset()
   
  
    |
    Improve this Doc
  
  
    View Source
  
  
  ToString()
  
  
  Declaration
  
    public override string ToString()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Boolean)
  
  
  Declaration
  
    public override void Write(bool value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Boolean | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Char)
  
  
  Declaration
  
    public override void Write(char value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Char[])
  
  
  Declaration
  
    public override void Write(char[] buffer)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char[] | 
        buffer | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Char[], Int32, Int32)
  
  
  Declaration
  
    public override void Write(char[] buffer, int index, int count)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char[] | 
        buffer | 
         | 
      
      
        | System.Int32 | 
        index | 
         | 
      
      
        | System.Int32 | 
        count | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Decimal)
  
  
  Declaration
  
    public override void Write(decimal value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Decimal | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Double)
  
  
  Declaration
  
    public override void Write(double value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Double | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Int32)
  
  
  Declaration
  
    public override void Write(int value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Int64)
  
  
  Declaration
  
    public override void Write(long value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int64 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Object)
  
  
  Declaration
  
    public override void Write(object value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Object | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(Single)
  
  
  Declaration
  
    public override void Write(float value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Single | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(String)
  
  
  Declaration
  
    public override void Write(string value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(String, Object)
  
  
  Declaration
  
    public override void Write(string format, object arg0)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object | 
        arg0 | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(String, Object, Object)
  
  
  Declaration
  
    public override void Write(string format, object arg0, object arg1)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object | 
        arg0 | 
         | 
      
      
        | System.Object | 
        arg1 | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(String, Object, Object, Object)
  
  
  Declaration
  
    public override void Write(string format, object arg0, object arg1, object arg2)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object | 
        arg0 | 
         | 
      
      
        | System.Object | 
        arg1 | 
         | 
      
      
        | System.Object | 
        arg2 | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(String, Object[])
  
  
  Declaration
  
    public override void Write(string format, params object[] arg)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object[] | 
        arg | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(UInt32)
  
  
  Declaration
  
    public override void Write(uint value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.UInt32 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  Write(UInt64)
  
  
  Declaration
  
    public override void Write(ulong value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.UInt64 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteAsync(Char)
  
  
  Declaration
  
    public override Task WriteAsync(char value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char | 
        value | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteAsync(Char[], Int32, Int32)
  
  
  Declaration
  
    public override Task WriteAsync(char[] buffer, int index, int count)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char[] | 
        buffer | 
         | 
      
      
        | System.Int32 | 
        index | 
         | 
      
      
        | System.Int32 | 
        count | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteAsync(String)
  
  
  Declaration
  
    public override Task WriteAsync(string value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        value | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine()
  
  
  Declaration
  
    public override void WriteLine()
   
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Boolean)
  
  
  Declaration
  
    public override void WriteLine(bool value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Boolean | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Char)
  
  
  Declaration
  
    public override void WriteLine(char value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Char[])
  
  
  Declaration
  
    public override void WriteLine(char[] buffer)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char[] | 
        buffer | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Char[], Int32, Int32)
  
  
  Declaration
  
    public override void WriteLine(char[] buffer, int index, int count)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char[] | 
        buffer | 
         | 
      
      
        | System.Int32 | 
        index | 
         | 
      
      
        | System.Int32 | 
        count | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Decimal)
  
  
  Declaration
  
    public override void WriteLine(decimal value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Decimal | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Double)
  
  
  Declaration
  
    public override void WriteLine(double value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Double | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Int32)
  
  
  Declaration
  
    public override void WriteLine(int value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Int64)
  
  
  Declaration
  
    public override void WriteLine(long value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int64 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Object)
  
  
  Declaration
  
    public override void WriteLine(object value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Object | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(Single)
  
  
  Declaration
  
    public override void WriteLine(float value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Single | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(String)
  
  
  Declaration
  
    public override void WriteLine(string value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(String, Object)
  
  
  Declaration
  
    public override void WriteLine(string format, object arg0)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object | 
        arg0 | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(String, Object, Object)
  
  
  Declaration
  
    public override void WriteLine(string format, object arg0, object arg1)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object | 
        arg0 | 
         | 
      
      
        | System.Object | 
        arg1 | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(String, Object, Object, Object)
  
  
  Declaration
  
    public override void WriteLine(string format, object arg0, object arg1, object arg2)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object | 
        arg0 | 
         | 
      
      
        | System.Object | 
        arg1 | 
         | 
      
      
        | System.Object | 
        arg2 | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(String, Object[])
  
  
  Declaration
  
    public override void WriteLine(string format, params object[] arg)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        format | 
         | 
      
      
        | System.Object[] | 
        arg | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(UInt32)
  
  
  Declaration
  
    public override void WriteLine(uint value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.UInt32 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLine(UInt64)
  
  
  Declaration
  
    public override void WriteLine(ulong value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.UInt64 | 
        value | 
         | 
      
    
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLineAsync()
  
  
  Declaration
  
    public override Task WriteLineAsync()
   
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLineAsync(Char)
  
  
  Declaration
  
    public override Task WriteLineAsync(char value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char | 
        value | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLineAsync(Char[], Int32, Int32)
  
  
  Declaration
  
    public override Task WriteLineAsync(char[] buffer, int index, int count)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Char[] | 
        buffer | 
         | 
      
      
        | System.Int32 | 
        index | 
         | 
      
      
        | System.Int32 | 
        count | 
         | 
      
    
  
  Returns
  
  
    |
    Improve this Doc
  
  
    View Source
  
  
  WriteLineAsync(String)
  
  
  Declaration
  
    public override Task WriteLineAsync(string value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        value | 
         | 
      
    
  
  Returns