private MemoryStream SerializeSelected() { var doc = new DiagramDocumentCore(); doc.Shapes.AddRange(_selectedShapes); // no need to populate doc.Styles, it is not used for copy/paste var buf = new MemoryStream(); doc.Save(buf); return buf; }