static void ApplyPropertiesCore(JsonLiteArray array, object result) { JsonLiteArray jsonValue = array as JsonLiteArray; if (jsonValue == null) { throw new JsonLiteDeserializationException(); } //TODO: }
static void ApplyProperties(JsonLiteObjectBase instance, object result) { Type type = result.GetType(); JsonLiteArray array = instance as JsonLiteArray; if (array != null) { ApplyPropertiesCore(array, result); return; } JsonLiteObject obj = instance as JsonLiteObject; if (obj != null) { ApplyPropertiesCore(obj, result); return; } }
static void ArrayExpectValue_Accept(ParserContext context, ParserContext innerContext) { JsonLiteArray array = (JsonLiteArray)context.Result; if (innerContext.State == JsonLiteParserState.ArrayExpectValue || innerContext.State == JsonLiteParserState.ObjectExpectValue || innerContext.State == JsonLiteParserState.ArrayExpectComma || innerContext.State == JsonLiteParserState.ObjectExpectComma || innerContext.State == JsonLiteParserState.ObjectExpectKey) { array.Values.Add(innerContext.Result); context.State = JsonLiteParserState.ArrayExpectComma; } else if (innerContext.State == JsonLiteParserState.ExpectQuotedValue || innerContext.State == JsonLiteParserState.ExpectValue) { array.Values.Add(new JsonLiteValue() { Value = innerContext.Text.ToString() }); context.State = JsonLiteParserState.ArrayExpectComma; } else { context.State = JsonLiteParserState.ParseFailed; } }