ReaderSvgGetCustomPropertiesDataTable Method |
Namespace: Ab2d
public DataTable GetCustomPropertiesDataTable()
Every shape that is defined in Microsoft Visio can contain custom properties. When saving the drawing into svg, the custom properties are preserved and can be get with GetCustomProperties(String), GetCustomProperties(Object), GetObjectsWithCustomProperties or GetCustomPropertiesDataTable.
Every custom property has its associated object, key as string and a value. The value is not always of type string. The following types are supported: string, double, Boolean, DateTime, TimeSpan, decimal (for Currency).
GetCustomProperties method can be called with object or with string representing an object name. The method returns a Dictionary<string, object>.
Ab2d.ReaderSvg has some methods that are specialized to read additional data from svg files that were created with Microsoft Visio.
To get all objects that have custom properties defined use GetObjectsWithCustomProperties method.
To get all custom properties in a DataTable use GetCustomPropertiesDataTable method.
The first column of the returned DataTable is named ObjectName and contains the name of the object that is associated with each DataRow. Names of other columns represent the names of custom properties.
Ab2d.ReaderSvg also supports layers defined in Microsoft Visio. To get information about the layers use GetLayerNames or GetElementsForLayerName(String).
The following example shows how to read all custom properties into a DataTable
Ab2d.ReaderSvg myReaderSvg; myReaderSvg = new Ab2d.ReaderSvg(); Viewbox myDiagram = myReaderSvg.Read(@"c:\myDiagram.svg"); // NOTE: // When SvgViewbox or SvgDrawing is used in XAML to read the svg file, // use its InnerReaderSvg property to get the ReaderSvg object. // Get all custom properties as a DataTable DataTable svgData = myReaderSvg.GetCustomPropertiesDataTable();