Working with Inherited Data

3 4

A shape (that is, an instance of a master) inherits much of its data from its master and from styles. Rather than make a local copy of every formula for a shape, an instance of a master inherits formulas from the master and from the styles applied to it. This behavior has two benefits: It allows changes to the master's formulas or the style definition to be propagated to all instances, and it results in smaller Microsoft Visio files because inherited formulas are stored once in the master, not once in each instance.

No local copy of the shape's data exists until you change some part of its data. Everything you do when adding, modifying, or deleting shape data affects the local formulas for the shape, not the master. If the data your program is trying to work with doesn't exist locally—that is, if the shape inherits the data from a master or style—Microsoft Visio first creates a local copy of the data, and then performs the requested action. Once data exists locally, inheritance for that data is severed, and changes to the data in the master no longer affect the shape's local data.

Be aware when you are writing programs that a shape might not have a local copy of all of the data that appears in its ShapeSheet window or that you can access from a program. The shape might behave as if the data were local, but some data might be local and other data might be inherited from a master or a style.

For example, if a shape is an instance of a master that has connection points, the shape inherits the master's connection points. The shape has the same connection point behavior as the master and displays the inherited Connection Points section in its ShapeSheet window. However, the shape doesn't have a local copy of the Connection Points data—instead, it inherits that data from the master. If you attempt to delete this shape's Connection Points section, the Connection Points data doesn't change because there is no local copy to delete, and the shape continues to inherit its Connection Points data from the master.

Overriding or restoring inheritance

To override inheritance for an entire section, either delete each row in the section, or delete the entire section and add a new, empty section of the same type. In the latter case, you delete the section to make sure no local copy already exists, which would cause an error if you attempted to add the section.

To restore an inherited section, delete the local copy. The shape inherits that section again from the master or style.

Note


In earlier versions of Microsoft Visio, Geometry formulas were always local. Beginning in Visio 2000, shapes inherit their geometry formulas from the master, which results in smaller and faster shapes. Any local overrides to these geometry formulas will cause the shape to get a local copy and increase in size. For this reason, you might want to consider making broad changes to the master.



Developing Microsoft Visio Solutions 2001
Developing Microsoft Visio Solutions (Pro-Documentation)
ISBN: 0735613532
EAN: 2147483647
Year: 2004
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net