Exemplo n.º 1
0
 protected override void DeserializeWithoutType(BinaryReader reader, int maxNestDepth)
 {
     if (maxNestDepth <= 0)
     {
         throw new FormatException();
     }
     Expression = DeserializeFrom(reader, maxNestDepth - 1);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Deserializes an <see cref="WitnessCondition"/> array from a <see cref="MemoryReader"/>.
 /// </summary>
 /// <param name="reader">The <see cref="MemoryReader"/> for reading data.</param>
 /// <param name="maxNestDepth">The maximum nesting depth allowed during deserialization.</param>
 /// <returns>The deserialized <see cref="WitnessCondition"/> array.</returns>
 protected static WitnessCondition[] DeserializeConditions(ref MemoryReader reader, int maxNestDepth)
 {
     WitnessCondition[] conditions = new WitnessCondition[reader.ReadVarInt(MaxSubitems)];
     for (int i = 0; i < conditions.Length; i++)
     {
         conditions[i] = DeserializeFrom(ref reader, maxNestDepth);
     }
     return(conditions);
 }
Exemplo n.º 3
0
 private protected override void ParseJson(JObject json)
 {
     Expression = FromJson(json["expression"]);
 }