Click or drag to resize
AB4D logo

ReaderSvgGetCustomPropertiesDataTable Method

Returns a System.Data.DataTable with all custom properties defined in svg file (only custom properties defined in Microsoft Visio are supported).

Namespace:  Ab2d
Assembly:  Ab2d.ReaderSvg (in Ab2d.ReaderSvg.dll) Version: 7.1.7295.1040
Syntax
C#
public DataTable GetCustomPropertiesDataTable()

Return Value

Type: DataTable
System.Data.DataTable with all custom properties defined in svg file
Remarks

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).

Examples

The following example shows how to read all custom properties into a DataTable

C#
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();
See Also