public static ProductLicence FromBinary(BinaryReader wr) { wr.ReadByte(); var res = new ProductLicence { ProductId = wr.ReadStringEx(), LicId = wr.ReadUInt16(), KeyIdAutoIncrement = wr.ReadInt32(), CourseDays = wr.ReadUInt16() }; var cnt = wr.ReadInt32(); if (cnt == 0) { res.Lics = new List<UsedKey>(); return res; } res.Lics = Enumerable.Range(0, cnt).Select(c => UsedKey.FromBinary(wr)).ToList(); return res; }
public static UsedKey FromBinary(BinaryReader wr) { wr.ReadByte(); return new UsedKey { LicKeyId = wr.ReadInt32(), email = wr.ReadStringEx() }; }