C# Класс NetServ.Net.Json.JsonWriter

Provided support for writing JavaScript Object Notation data types to an underlying System.IO.TextWriter.
Наследование: Disposable, IJsonWriter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Close ( ) : void

Closes this writer.

JsonWriter ( ) : System

Initialises a new instance of then JsonWriter class using a System.IO.StringWriter as the underlying System.IO.TextWriter.

JsonWriter ( TextWriter writer, bool ownsWriter ) : System

Initialises a new instance of the JsonWriter class and specifies the underlying System.IO.TextWriter and a value indicating if the instance owns the specified TextWriter.

ToString ( ) : string

Returns a System.String representation of this instance.

WriteBeginArray ( ) : void

Writes the start of an array to the underlying data stream.

WriteBeginObject ( ) : void

Writes the start of an object to the underlying data stream.

WriteEndArray ( ) : void

Writes the end of an array to the underlying data stream.

WriteEndObject ( ) : void

Writes the end of an object to the underlying data stream.

WriteName ( string value ) : void

Writes a object property name to the underlying data stream.

WriteValue ( string value ) : void

Writes a raw string value to the underlying data stream.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Disposed of this instance.

PostWrite ( JsonTokenType token ) : void

Performs any post write operations needed after the specified token has been written to the underlying stream.

PreWrite ( JsonTokenType token ) : void

Performs any assertions and / or write operations needed before the specified token is written to the underlying stream.

Приватные методы

Метод Описание
Assert ( bool cond, JsonTokenType nextToken ) : void
IsStructEnd ( JsonTokenType token ) : bool
IsStructStart ( JsonTokenType token ) : bool

Описание методов

Close() публичный Метод

Closes this writer.
public Close ( ) : void
Результат void

Dispose() защищенный Метод

Disposed of this instance.
protected Dispose ( bool disposing ) : void
disposing bool True if being called explicitly, otherwise; false /// to indicate being called implicitly by the GC.
Результат void

JsonWriter() публичный Метод

Initialises a new instance of then JsonWriter class using a System.IO.StringWriter as the underlying System.IO.TextWriter.
public JsonWriter ( ) : System
Результат System

JsonWriter() публичный Метод

Initialises a new instance of the JsonWriter class and specifies the underlying System.IO.TextWriter and a value indicating if the instance owns the specified TextWriter.
public JsonWriter ( TextWriter writer, bool ownsWriter ) : System
writer System.IO.TextWriter The underlying text writer.
ownsWriter bool True if this instance owns the specified TextWriter, /// otherwise; false.
Результат System

PostWrite() защищенный Метод

Performs any post write operations needed after the specified token has been written to the underlying stream.
protected PostWrite ( JsonTokenType token ) : void
token JsonTokenType The token written.
Результат void

PreWrite() защищенный Метод

Performs any assertions and / or write operations needed before the specified token is written to the underlying stream.
protected PreWrite ( JsonTokenType token ) : void
token JsonTokenType The next token to be written.
Результат void

ToString() публичный Метод

Returns a System.String representation of this instance.
public ToString ( ) : string
Результат string

WriteBeginArray() публичный Метод

Writes the start of an array to the underlying data stream.
public WriteBeginArray ( ) : void
Результат void

WriteBeginObject() публичный Метод

Writes the start of an object to the underlying data stream.
public WriteBeginObject ( ) : void
Результат void

WriteEndArray() публичный Метод

Writes the end of an array to the underlying data stream.
public WriteEndArray ( ) : void
Результат void

WriteEndObject() публичный Метод

Writes the end of an object to the underlying data stream.
public WriteEndObject ( ) : void
Результат void

WriteName() публичный Метод

Writes a object property name to the underlying data stream.
public WriteName ( string value ) : void
value string The property name.
Результат void

WriteValue() публичный Метод

Writes a raw string value to the underlying data stream.
public WriteValue ( string value ) : void
value string The string to write.
Результат void