Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Class: RT.Json.JsonRaw

Summary

A special type of value which is never produced as a result of parsing valid JSON. Its sole purpose is to allow embedding arbitrary JavaScript code using JsonValue.Fmt(string, params JsonValue[]).

Constructors

JsonRaw(string raw)
A special type of value which is never produced as a result of parsing valid JSON. Its sole purpose is to allow embedding arbitrary JavaScript code using JsonValue.Fmt(string, params JsonValue[]).

Instance methods

void Add the specified item to the current list if it is a JsonList; otherwise, throws.
void
Add(string key, JsonValue value)
Adds the specified key/value pair to the dictionary if this is a JsonDict; otherwise, throws.
void
AddRange(IEnumerable<JsonValue> items)
Add the specified items to the current list if it is a JsonList; otherwise, throws.
void
AddRange(IEnumerable<KeyValuePair<string, JsonValue>> items)
Add the specified items to the current dictionary if it is a JsonDict; otherwise, throws.
void
AppendIndented(StringBuilder sb, int indentation = 0)
Converts the current JSON value to a JSON string that parses back to this value.
void Removes all items from the current value if it is a JsonList or JsonDict; otherwise, throws.
bool Determines whether the specified item is contained in the current list if it is a JsonList; otherwise, throws.
bool
ContainsKey(string key)
Determines whether an entry with the specified key exists in the dictionary if this is a JsonDict; otherwise, throws.
void
CopyTo(JsonValue[] array, int arrayIndex)
Copies the entire list to a compatible one-dimensional array, starting at the specified arrayIndex of the target array, if this is a JsonList; otherwise, throws.
bool
Equals(object other)
  • Overrides: object.Equals(object)
See JsonValue.Equals(JsonValue).
bool
bool
boolConverts the current value to a bool. Throws if the conversion is not valid.
bool Converts the current value to a bool by using the BoolConversionOptions.Lenient option. Throws if the conversion is not valid.
bool? Converts the current value to a bool by using the BoolConversionOptions.Lenient option. Returns null if the conversion is not valid.
bool?Converts the current value to a bool. Returns null if the conversion is not valid.
decimalConverts the current value to a decimal. Throws if the conversion is not valid.
decimal Converts the current value to a decimal by using the NumericConversionOptions.Lenient option. Throws if the conversion is not valid.
decimal? Converts the current value to a decimal by using the NumericConversionOptions.Lenient option. Returns null if the conversion is not valid.
decimal?Converts the current value to a decimal. Returns null if the conversion is not valid.
JsonDictConverts the current value to JsonDict if it is a JsonDict; otherwise, throws.
JsonDict Converts the current value to JsonDict if it is a JsonDict; otherwise, returns null.
doubleConverts the current value to a double. Throws if the conversion is not valid.
double Converts the current value to a double by using the NumericConversionOptions.Lenient option. Throws if the conversion is not valid.
double? Converts the current value to a double by using the NumericConversionOptions.Lenient option. Returns null if the conversion is not valid.
double?Converts the current value to a double. Returns null if the conversion is not valid.
int
  • Overrides: object.GetHashCode()
Returns a hash code representing this object.
intConverts the current value to an int. Throws if the conversion is not valid.
int Converts the current value to an int by using the NumericConversionOptions.Lenient option. Throws if the conversion is not valid.
int? Converts the current value to an int by using the NumericConversionOptions.Lenient option. Returns null if the conversion is not valid.
int?Converts the current value to an int. Returns null if the conversion is not valid.
JsonListConverts the current value to JsonList if it is a JsonList; otherwise, throws.
JsonList Converts the current value to JsonList if it is a JsonList; otherwise, returns null.
longConverts the current value to a long. Throws if the conversion is not valid.
long Converts the current value to a long by using the NumericConversionOptions.Lenient option. Throws if the conversion is not valid.
long? Converts the current value to a long by using the NumericConversionOptions.Lenient option. Returns null if the conversion is not valid.
long?Converts the current value to a long. Returns null if the conversion is not valid.
stringConverts the current value to a string. Throws if the conversion is not valid.
string Converts the current value to a string by using the StringConversionOptions.Lenient option. Throws if the conversion is not valid.
string Converts the current value to a string by using the StringConversionOptions.Lenient option. Returns null if the conversion is not valid.
stringConverts the current value to a string. Returns null if the conversion is not valid.
ulongConverts the current value to a ulong. Throws if the conversion is not valid.
ulong Converts the current value to a ulong by using the NumericConversionOptions.Lenient option. Throws if the conversion is not valid.
ulong? Converts the current value to a ulong by using the NumericConversionOptions.Lenient option. Returns null if the conversion is not valid.
ulong?Converts the current value to a ulong. Returns null if the conversion is not valid.
int Returns the index of the first occurrence of the specified item within the current list if it is a JsonList; otherwise, throws.
void
Insert(int index, JsonValue item)
Inserts the specified item at the specified index to the current list if it is a JsonList; otherwise, throws.
bool Removes the first instance of the specified item from the current list if it is a JsonList; otherwise, throws.
bool
Remove(string key)
Removes the entry with the specified key from the dictionary if this is a JsonDict; otherwise, throws.
void
RemoveAt(int index)
Removes the item at the specified index from the current list if it is a JsonList; otherwise, throws.
IEnumerable<string>See JsonValue.ToEnumerable().
string
  • Inherited from JsonValue
  • Overrides: object.ToString()
Converts the current JSON value to a JSON string that parses back to this value.
string
bool
TryGetValue(string key, out JsonValue value)
Attempts to retrieve the value associated with the specified key if this is a JsonDict; otherwise, throws.

Static methods

JsonRaw
FromDate(DateTime datetime)
Generates a JsonRaw instance from the specified date/time stamp.

Instance properties

stringGets the raw JSON.