public static LrpQuoteEntry[] ReadQuoteEntryArray(this TextStream stream, string name = null) { if (name != null) { stream.ValidateVerbatimText(name); stream.ValidateVerbatimText(" = "); } stream.ValidateVerbatimText('['); var count = stream.ReadInt32(); stream.ValidateVerbatimText("]{"); var result = new LrpQuoteEntry[count]; if (count > 0) { var _value = stream.ReadQuoteEntry(null); result[0] = _value; stream.ValidateVerbatimText(";"); } for (int index = 1; index < count; ++index) { stream.ValidateVerbatimText(" "); var _value = stream.ReadQuoteEntry(null); result[index] = _value; stream.ValidateVerbatimText(";"); } stream.ValidateVerbatimText('}'); return result; }
public static LrpQuoteEntry ReadQuoteEntry(this TextStream stream, string name = null) { if (name != null) { stream.ValidateVerbatimText(name); stream.ValidateVerbatimText(" = "); } var result = new LrpQuoteEntry(); stream.ValidateVerbatimText('{'); result.Price = stream.ReadDouble("Price"); stream.ValidateVerbatimText(';'); result.Volume = stream.ReadDouble("Volume"); stream.ValidateVerbatimText(';'); stream.ValidateVerbatimText('}'); return result; }