protected override object ImportFromBoolean(ImportContext context, JsonReader reader) { Debug.Assert(context != null); Debug.Assert(reader != null); return(BooleanObject.Box(reader.ReadBoolean())); }
protected override object ImportFromNumber(ImportContext context, JsonReader reader) { Debug.Assert(context != null); Debug.Assert(reader != null); try { return(BooleanObject.Box(reader.ReadNumber().ToInt64() != 0)); } catch (FormatException innerException) { throw new JsonException($"The JSON Number {reader.Text} must be an integer to be convertible to System.Boolean.", innerException); } }
protected override object ImportFromBoolean(ImportContext context, JsonReader reader) { return BooleanObject.Box(reader.ReadBoolean()); }
protected override object ImportFromBoolean(ImportContext context, JsonReader reader) { return(Convert.ChangeType(BooleanObject.Box(reader.ReadBoolean()), OutputType)); }