public static void BinRestoreFig(byte[] bin, CadFigure fig, CadObjectDB db = null) { MpFigure_v1002 mpfig = MessagePackSerializer.Deserialize <MpFigure_v1002>(bin); mpfig.RestoreTo(fig); SetChildren(fig, mpfig.ChildIdList, db); }
public static void Lz4BinRestoreFig(byte[] bin, CadFigure fig, CadObjectDB db = null) { var lz4Options = MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray); MpFigure_v1002 mpfig = MessagePackSerializer.Deserialize <MpFigure_v1002>(bin, lz4Options); mpfig.RestoreTo(fig); SetChildren(fig, mpfig.ChildIdList, db); }
public static void CopyTo(CadFigure src, CadFigure dst) { MpFigure_v1002 mpf = MpFigure_v1002.Create(src, false); byte[] data = MessagePackSerializer.Serialize(mpf); MpFigure_v1002 mpfCopy = MessagePackSerializer.Deserialize <MpFigure_v1002>(data); uint id = dst.ID; mpfCopy.RestoreTo(dst); dst.ID = id; }