Class LenientStringToIntConverter
The lenient StringToIntConverter allows for int or int? objects have alphabetic characters.
If the string is not parsable as integer 0 is used in case of (int) and null in case of (int?).
Inheritance
System.Object
LenientStringToIntConverter
Assembly: BO4Enet.dll
public class LenientStringToIntConverter : JsonConverter
(string)"12" will be parsed as (int)12 where an integer value is expected.
Properties
|
Improve this Doc
View Source
Declaration
public override bool CanWrite { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Methods
|
Improve this Doc
View Source
Declaration
public override bool CanConvert(Type objectType)
Parameters
| Type |
Name |
Description |
| Type |
objectType |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
Parameters
| Type |
Name |
Description |
| JsonReader |
reader |
|
| Type |
objectType |
|
| System.Object |
existingValue |
|
| JsonSerializer |
serializer |
|
Returns
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
Declaration
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Parameters
| Type |
Name |
Description |
| JsonWriter |
writer |
|
| System.Object |
value |
|
| JsonSerializer |
serializer |
|
Extension Methods