Ejemplo n.º 1
0
 /// <summary>
 /// Deserialize a PropInfo instance from a FastTransferStream
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>A PropInfo instance.</returns>
 public static LexicalBase DeserializeFrom(FastTransferStream stream)
 {
     if (TaggedPropIdPropInfo.Verify(stream))
     {
         return(TaggedPropIdPropInfo.DeserializeFrom(stream));
     }
     else if (NamedPropIdPropInfo.Verify(stream))
     {
         return(NamedPropIdPropInfo.DeserializeFrom(stream));
     }
     else
     {
         AdapterHelper.Site.Assert.Fail("The stream cannot be deserialized successfully.");
         return(null);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Verify that a stream's current position contains a serialized PropInfo.
 /// </summary>
 /// <param name="stream">A FastTransferStream.</param>
 /// <returns>If the stream's current position contains
 /// a serialized PropInfo, return true, else false.</returns>
 public static bool Verify(FastTransferStream stream)
 {
     return(TaggedPropIdPropInfo.Verify(stream) ||
            NamedPropIdPropInfo.Verify(stream));
 }