14 [__DynamicallyInvokable]
18 private sealed
class NullTextWriter :
TextWriter 22 internal NullTextWriter()
27 public override void Write(
char[] buffer,
int index,
int count)
31 public override void Write(
string value)
39 public override void WriteLine(
string value)
43 public override void WriteLine(
object value)
78 public override void Close()
84 protected override void Dispose(
bool disposing)
93 public override void Flush()
99 public override void Write(
char value)
105 public override void Write(
char[] buffer)
111 public override void Write(
char[] buffer,
int index,
int count)
113 _out.Write(buffer, index, count);
117 public override void Write(
bool value)
123 public override void Write(
int value)
129 public override void Write(uint value)
135 public override void Write(
long value)
141 public override void Write(ulong value)
147 public override void Write(
float value)
153 public override void Write(
double value)
159 public override void Write(decimal value)
165 public override void Write(
string value)
171 public override void Write(
object value)
177 public override void Write(
string format,
object arg0)
179 _out.Write(format, arg0);
183 public override void Write(
string format,
object arg0,
object arg1)
185 _out.Write(format, arg0, arg1);
189 public override void Write(
string format,
object arg0,
object arg1,
object arg2)
191 _out.Write(format, arg0, arg1, arg2);
195 public override void Write(
string format, params
object[] arg)
197 _out.Write(format, arg);
207 public override void WriteLine(
char value)
209 _out.WriteLine(value);
213 public override void WriteLine(decimal value)
215 _out.WriteLine(value);
219 public override void WriteLine(
char[] buffer)
221 _out.WriteLine(buffer);
225 public override void WriteLine(
char[] buffer,
int index,
int count)
227 _out.WriteLine(buffer, index, count);
231 public override void WriteLine(
bool value)
233 _out.WriteLine(value);
237 public override void WriteLine(
int value)
239 _out.WriteLine(value);
243 public override void WriteLine(uint value)
245 _out.WriteLine(value);
249 public override void WriteLine(
long value)
251 _out.WriteLine(value);
255 public override void WriteLine(ulong value)
257 _out.WriteLine(value);
261 public override void WriteLine(
float value)
263 _out.WriteLine(value);
267 public override void WriteLine(
double value)
269 _out.WriteLine(value);
273 public override void WriteLine(
string value)
275 _out.WriteLine(value);
279 public override void WriteLine(
object value)
281 _out.WriteLine(value);
285 public override void WriteLine(
string format,
object arg0)
287 _out.WriteLine(format, arg0);
291 public override void WriteLine(
string format,
object arg0,
object arg1)
293 _out.WriteLine(format, arg0, arg1);
297 public override void WriteLine(
string format,
object arg0,
object arg1,
object arg2)
299 _out.WriteLine(format, arg0, arg1, arg2);
303 public override void WriteLine(
string format, params
object[] arg)
305 _out.WriteLine(format, arg);
326 public override Task WriteAsync(
char[] buffer,
int index,
int count)
328 Write(buffer, index, count);
366 [__DynamicallyInvokable]
370 private static Action<object> _WriteCharDelegate = delegate(
object state)
373 tuple6.Item1.Write(tuple6.Item2);
377 private static Action<object> _WriteStringDelegate = delegate(
object state)
380 tuple5.Item1.Write(tuple5.Item2);
384 private static Action<object> _WriteCharArrayRangeDelegate = delegate(
object state)
387 tuple4.Item1.Write(tuple4.Item2, tuple4.Item3, tuple4.Item4);
391 private static Action<object> _WriteLineCharDelegate = delegate(
object state)
393 Tuple<TextWriter, char> tuple3 = (Tuple<TextWriter, char>)state;
394 tuple3.Item1.WriteLine(tuple3.Item2);
398 private static Action<object> _WriteLineStringDelegate = delegate(
object state)
400 Tuple<TextWriter, string> tuple2 = (Tuple<TextWriter, string>)state;
401 tuple2.Item1.WriteLine(tuple2.Item2);
405 private static Action<object> _WriteLineCharArrayRangeDelegate = delegate(
object state)
407 Tuple<TextWriter, char[], int, int> tuple = (Tuple<TextWriter, char[], int, int>)state;
408 tuple.Item1.WriteLine(tuple.Item2, tuple.Item3, tuple.Item4);
412 private static Action<object> _FlushDelegate = delegate(
object state)
417 private const string InitialNewLine =
"\r\n";
420 [__DynamicallyInvokable]
431 [__DynamicallyInvokable]
434 [__DynamicallyInvokable]
437 if (InternalFormatProvider ==
null)
441 return InternalFormatProvider;
447 [__DynamicallyInvokable]
450 [__DynamicallyInvokable]
456 [__DynamicallyInvokable]
459 [__DynamicallyInvokable]
464 [__DynamicallyInvokable]
476 [__DynamicallyInvokable]
479 InternalFormatProvider =
null;
484 [__DynamicallyInvokable]
487 InternalFormatProvider = formatProvider;
500 [__DynamicallyInvokable]
501 protected virtual void Dispose(
bool disposing)
506 [__DynamicallyInvokable]
514 [__DynamicallyInvokable]
524 [HostProtection(
SecurityAction.LinkDemand, Synchronization =
true)]
531 if (writer is SyncTextWriter)
535 return new SyncTextWriter(writer);
542 [__DynamicallyInvokable]
543 public virtual void Write(
char value)
551 [__DynamicallyInvokable]
552 public virtual void Write(
char[] buffer)
556 Write(buffer, 0, buffer.Length);
570 [__DynamicallyInvokable]
571 public virtual void Write(
char[] buffer,
int index,
int count)
585 if (buffer.Length - index < count)
589 for (
int i = 0; i < count; i++)
591 Write(buffer[index + i]);
599 [__DynamicallyInvokable]
600 public virtual void Write(
bool value)
602 Write(value ?
"True" :
"False");
609 [__DynamicallyInvokable]
610 public virtual void Write(
int value)
619 [CLSCompliant(
false)]
620 [__DynamicallyInvokable]
621 public virtual void Write(uint value)
630 [__DynamicallyInvokable]
631 public virtual void Write(
long value)
640 [CLSCompliant(
false)]
641 [__DynamicallyInvokable]
642 public virtual void Write(ulong value)
651 [__DynamicallyInvokable]
652 public virtual void Write(
float value)
661 [__DynamicallyInvokable]
662 public virtual void Write(
double value)
671 [__DynamicallyInvokable]
672 public virtual void Write(decimal value)
681 [__DynamicallyInvokable]
682 public virtual void Write(
string value)
686 Write(value.ToCharArray());
694 [__DynamicallyInvokable]
695 public virtual void Write(
object value)
700 if (formattable !=
null)
706 Write(value.ToString());
720 [__DynamicallyInvokable]
721 public virtual void Write(
string format,
object arg0)
736 [__DynamicallyInvokable]
737 public virtual void Write(
string format,
object arg0,
object arg1)
753 [__DynamicallyInvokable]
754 public virtual void Write(
string format,
object arg0,
object arg1,
object arg2)
768 [__DynamicallyInvokable]
769 public virtual void Write(
string format, params
object[] arg)
777 [__DynamicallyInvokable]
787 [__DynamicallyInvokable]
798 [__DynamicallyInvokable]
815 [__DynamicallyInvokable]
816 public virtual void WriteLine(
char[] buffer,
int index,
int count)
818 Write(buffer, index, count);
826 [__DynamicallyInvokable]
837 [__DynamicallyInvokable]
848 [CLSCompliant(
false)]
849 [__DynamicallyInvokable]
860 [__DynamicallyInvokable]
871 [CLSCompliant(
false)]
872 [__DynamicallyInvokable]
883 [__DynamicallyInvokable]
894 [__DynamicallyInvokable]
905 [__DynamicallyInvokable]
916 [__DynamicallyInvokable]
924 int length = value.Length;
926 char[] array =
new char[length + num];
927 value.CopyTo(0, array, 0, length);
941 Write(array, 0, length + num);
948 [__DynamicallyInvokable]
957 if (formattable !=
null)
976 [__DynamicallyInvokable]
977 public virtual void WriteLine(
string format,
object arg0)
992 [__DynamicallyInvokable]
993 public virtual void WriteLine(
string format,
object arg0,
object arg1)
1009 [__DynamicallyInvokable]
1010 public virtual void WriteLine(
string format,
object arg0,
object arg1,
object arg2)
1023 [__DynamicallyInvokable]
1024 public virtual void WriteLine(
string format, params
object[] arg)
1035 [__DynamicallyInvokable]
1036 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1049 [__DynamicallyInvokable]
1050 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1063 [__DynamicallyInvokable]
1064 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1087 [__DynamicallyInvokable]
1088 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1101 [__DynamicallyInvokable]
1102 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1115 [__DynamicallyInvokable]
1116 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1129 [__DynamicallyInvokable]
1130 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1153 [__DynamicallyInvokable]
1154 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1166 [__DynamicallyInvokable]
1167 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
1178 [__DynamicallyInvokable]
1179 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
Represents a character encoding.To browse the .NET Framework source code for this type,...
static Thread CurrentThread
Gets the currently running thread.
static new TaskFactory< TResult > Factory
Provides access to factory methods for creating and configuring T:System.Threading....
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
virtual void WriteLine(bool value)
Writes the text representation of a Boolean value followed by a line terminator to the text string or...
virtual void Dispose(bool disposing)
Releases the unmanaged resources used by the T:System.IO.TextWriter and optionally releases the manag...
virtual Task WriteAsync(char value)
Writes a character to the text string or stream asynchronously.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
virtual void Write(uint value)
Writes the text representation of a 4-byte unsigned integer to the text string or stream.
Task WriteLineAsync(char[] buffer)
Writes an array of characters followed by a line terminator asynchronously to the text string or stre...
virtual void WriteLine(float value)
Writes the text representation of a 4-byte floating-point value followed by a line terminator to the ...
Propagates notification that operations should be canceled.
virtual void WriteLine(char value)
Writes a character followed by a line terminator to the text string or stream.
virtual void Write(decimal value)
Writes the text representation of a decimal value to the text string or stream.
Provides static methods for creating tuple objects. To browse the .NET Framework source code for this...
static void SuppressFinalize(object obj)
Requests that the common language runtime not call the finalizer for the specified object.
Task WriteAsync(char[] buffer)
Writes a character array to the text string or stream asynchronously.
static Encoding Default
Gets an encoding for the operating system's current ANSI code page.
virtual void WriteLine(string format, object arg0)
Writes a formatted string and a new line to the text string or stream, using the same semantics as th...
virtual void WriteLine(uint value)
Writes the text representation of a 4-byte unsigned integer followed by a line terminator to the text...
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
TextWriter(IFormatProvider formatProvider)
Initializes a new instance of the T:System.IO.TextWriter class with the specified format provider.
virtual void Write(int value)
Writes the text representation of a 4-byte signed integer to the text string or stream.
Represents an object that handles the low-level work of queuing tasks onto threads.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
TextWriter()
Initializes a new instance of the T:System.IO.TextWriter class.
virtual void Write(float value)
Writes the text representation of a 4-byte floating-point value to the text string or stream.
virtual Task WriteAsync(string value)
Writes a string to the text string or stream asynchronously.
void Dispose()
Releases all resources used by the T:System.IO.TextWriter object.
TaskCreationOptions
Specifies flags that control optional behavior for the creation and execution of tasks.
virtual Task WriteLineAsync(char[] buffer, int index, int count)
Writes a subarray of characters followed by a line terminator asynchronously to the text string or st...
virtual void Write(bool value)
Writes the text representation of a Boolean value to the text string or stream.
static TaskScheduler Default
Gets the default T:System.Threading.Tasks.TaskScheduler instance that is provided by the ....
SecurityAction
Specifies the security actions that can be performed using declarative security.
CultureInfo?? CurrentCulture
Gets or sets the culture for the current thread.
Provides information about, and means to manipulate, the current environment and platform....
virtual Task WriteLineAsync(string value)
Writes a string followed by a line terminator asynchronously to the text string or stream.
virtual void WriteLine(ulong value)
Writes the text representation of an 8-byte unsigned integer followed by a line terminator to the tex...
virtual void Write(double value)
Writes the text representation of an 8-byte floating-point value to the text string or stream.
virtual void WriteLine(char[] buffer)
Writes an array of characters followed by a line terminator to the text string or stream.
virtual void Write(string format, object arg0)
Writes a formatted string to the text string or stream, using the same semantics as the M:System....
virtual void Write(ulong value)
Writes the text representation of an 8-byte unsigned integer to the text string or stream.
Represents a writer that can write a sequential series of characters. This class is abstract.
virtual void Write(object value)
Writes the text representation of an object to the text string or stream by calling the ToString meth...
virtual void Write(long value)
Writes the text representation of an 8-byte signed integer to the text string or stream.
virtual void WriteLine(decimal value)
Writes the text representation of a decimal value followed by a line terminator to the text string or...
virtual void Write(char[] buffer, int index, int count)
Writes a subarray of characters to the text string or stream.
virtual void WriteLine(long value)
Writes the text representation of an 8-byte signed integer followed by a line terminator to the text ...
virtual void Write(char[] buffer)
Writes a character array to the text string or stream.
static Task CompletedTask
Gets a task that has already completed successfully.
MethodImplOptions
Defines the details of how a method is implemented.
virtual string NewLine
Gets or sets the line terminator string used by the current TextWriter.
virtual void Flush()
Clears all buffers for the current writer and causes any buffered data to be written to the underlyin...
static CancellationToken None
Returns an empty T:System.Threading.CancellationToken value.
char [] CoreNewLine
Stores the newline characters used for this TextWriter.
Controls the system garbage collector, a service that automatically reclaims unused memory.
The exception that is thrown when one of the arguments provided to a method is not valid.
virtual void WriteLine(string format, object arg0, object arg1, object arg2)
Writes out a formatted string and a new line, using the same semantics as M:System....
virtual void WriteLine(object value)
Writes the text representation of an object by calling the ToString method on that object,...
virtual void WriteLine(string format, object arg0, object arg1)
Writes a formatted string and a new line to the text string or stream, using the same semantics as th...
virtual void Write(string value)
Writes a string to the text string or stream.
virtual void WriteLine(string value)
Writes a string followed by a line terminator to the text string or stream.
virtual Task FlushAsync()
Asynchronously clears all buffers for the current writer and causes any buffered data to be written t...
virtual void Write(string format, params object[] arg)
Writes a formatted string to the text string or stream, using the same semantics as the M:System....
static TextWriter Synchronized(TextWriter writer)
Creates a thread-safe wrapper around the specified TextWriter.
Specifies that the class can be serialized.
virtual void WriteLine(int value)
Writes the text representation of a 4-byte signed integer followed by a line terminator to the text s...
virtual void WriteLine()
Writes a line terminator to the text string or stream.
virtual void Close()
Closes the current writer and releases any system resources associated with the writer.
virtual void WriteLine(string format, params object[] arg)
Writes out a formatted string and a new line, using the same semantics as M:System....
virtual void WriteLine(char[] buffer, int index, int count)
Writes a subarray of characters followed by a line terminator to the text string or stream.
virtual Task WriteAsync(char[] buffer, int index, int count)
Writes a subarray of characters to the text string or stream asynchronously.
Manipulates arrays of primitive types.
virtual void Write(string format, object arg0, object arg1)
Writes a formatted string to the text string or stream, using the same semantics as the M:System....
Encoding()
Initializes a new instance of the T:System.Text.Encoding class.
static readonly TextWriter Null
Provides a TextWriter with no backing store that can be written to, but not read from.
virtual void WriteLine(double value)
Writes the text representation of a 8-byte floating-point value followed by a line terminator to the ...
Provides information about a specific culture (called a locale for unmanaged code development)....
virtual Task WriteLineAsync()
Writes a line terminator asynchronously to the text string or stream.
virtual void Write(char value)
Writes a character to the text string or stream.
virtual Task WriteLineAsync(char value)
Writes a character followed by a line terminator asynchronously to the text string or stream.
virtual IFormatProvider FormatProvider
Gets an object that controls formatting.
virtual void Write(string format, object arg0, object arg1, object arg2)
Writes a formatted string to the text string or stream, using the same semantics as the M:System....
Represents an asynchronous operation that can return a value.
Enables access to objects across application domain boundaries in applications that support remoting.
Creates and controls a thread, sets its priority, and gets its status.