Hi,
The problems with connectors serialization in binary format is fixed in the latest version of Nevron Diagram for .NET. In order to clone a drawing document you can now create a simple method that serializes the drawing document to a memory stream in binary format and then deserializes it from the same stream. The following is a simple implementation of such method:
private static NDrawingDocument CloneDocument(NDrawingDocument document)
{
NDrawingDocument clonedDocument;
using (MemoryStream stream = new MemoryStream())
{
// Serialize the document to stream
NPersistencyManager manager = new NPersistencyManager();
manager.Persistentdocument.Sections.Add(new NPersistentSection("Drawing", document));
manager.SaveToStream(stream, PersistencyFormat.Binary, null);
// Deserialize the document from the stream
manager.LoadFromStream(stream, PersistencyFormat.Binary, null);
clonedDocument = (NDrawingDocument)manager.Persistentdocument.Sections.GetByName("Drawing").Object;
}
return clonedDocument;
}