This project has moved and is read-only. For the latest updates, please go here.

Shape Tag

Jul 14, 2013 at 12:25 PM
Edited Jul 14, 2013 at 12:27 PM
Hello Mr Kurt

I want To ask, about shape when i set tag to shape and i saved diagram using :
and i closed the project and i opened again i want check tag of the shape why tag not saved,How to saved tag every shape where i set in diagram please help Thanks you very much

Best Regards

Jul 15, 2013 at 1:05 PM
Hello Sonson,

the Tag property of shapes will not be saved. This is not a bug, it's a design decision.
Reasons for this decision:
  • The Tag property is not saved because it is meant as temporary storage property for user defined data.
  • As the Tag property is of type object and you can assign anything you want to it, there is no proper way for the NShape framework how to serialize / deserialize this property
If you need to store custom data in your shapes, you have to derive your own shape and implement the following methods:
  • GetPropertyDefinitions(int version) (this is a static method)
  • LoadFieldsCore
  • SaveFieldsCore
See documentation "Programmer Tasks > Developing a New Shape Class > Adding Persistency Support > Implementing the Load Method" or the base classes implementations for details.