Пример #1
0
 /// <summary>
 /// Deserialization support.
 /// </summary>
 /// <param name="bytes">Byte representation of the progress vector.</param>
 /// <returns></returns>
 public static ProgressVector FromBytes(byte[] value)
 {
     using (MemoryStream mem = new MemoryStream(value))
     {
         BinaryReader br = new BinaryReader(mem);
         return(ProgressVector.Read(br));
     }
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="br"></param>
        /// <returns></returns>
        internal static ProgressVector Read(BinaryReader br)
        {
            int count = br.ReadInt32();

            if (0 == count)
            {
                return(null);
            }
            ProgressVector pv = new ProgressVector();

            for (int i = 0; i < count; i++)
            {
                StateVersion sv = StateVersion.Read(br);
                pv.progress.Add(sv);
            }
            return(pv);
        }