public static void Read(object obj, Writer writer, ObjectParsingOptions options = null) { ObjectReader reader = new ObjectReader(writer, options ?? new ObjectParsingOptions()); try { reader.Read(obj); } catch (Exception e) { throw new ObjectReadException(reader, e); } }
public virtual void Read(object value, ObjectReader reader, Writer writer) { InnerDefinition.Read(value, reader, writer); }
public void Read(object value, ObjectReader reader, Writer writer) { TypeDef.ReadObject(value, reader, writer, PartialOptions.Default); }
private static string BuildMessage(ObjectReader reader, Exception innerException) { string propertyStack = reader.PropertyStack .Select(p => p.FullName) .Join(Environment.NewLine); return "{1}{0}At: {2}".FormatWith(Environment.NewLine, innerException.Message, propertyStack); }
public ObjectReadException(ObjectReader reader, Exception innerException) : base(BuildMessage(reader, innerException), innerException) { }
public void ReadObject(object input, ObjectReader reader, Writer writer, PartialOptions optionsOverride) { if (input == null) writer.WriteNull(); else if (isSealed || input.GetType() == Type) Read(input, reader, writer, optionsOverride); else { TypeDefinition inputTypeDef = TypeCache.GetTypeDefinition(input); optionsOverride.SerializeTypeInformation = TypeInformationLevel.Minimal; inputTypeDef.Read(input, reader, writer, optionsOverride); } }
public abstract void Read(object input, ObjectReader reader, Writer writer, PartialOptions optionsOverride);