Each new item, created either by the user or programmatically, is initialized with some kind of default property values.
If you create items by using the new operator and adding them the diagram's Nodes or Links collection, you can initialize the items by passing a Diagram reference to the respective constructor, or by passing another item to the copy constructor. In the former case, item properties are initialized from the default-property values defined in Diagram. In the latter case, properties are copied from the prototype item.
When users draw new items, the items are initialized from the Diagram properties, but you can change the default values by handling the InitializeNode and InitializeLink events.
Items created via the diagram's Factory object are always initialized from the default-property values defined in Diagram.
Below are listed item properties and the corresponding constants or Diagram properties through which they are initialized:
DiagramItem Property | Initialized With |
---|---|
Font | Font |
false | |
Pen | |
Tag | null |
ToolTip | (empty string) |
true |
ShapeNode Property | Initialized With |
---|---|
null | |
Text | |
TextColor | TextColor |
TextFormat | TextFormat |
false |
ContainerNode Property | Initialized With |
---|---|
false | |
Black | |
CaptionFormat | |
false | |
TableNode Property | Initialized With |
---|---|
Color.FromArgb(0, 0, 0) | |
CaptionFormat | Centered horizontal and vertical alignment |
null | |
TextColor |
DiagramLink Property | Initialized With |
---|---|
Text | |
TextColor | |