Extension methods
Namespace
Summary
The VisioAutomation.Extensions contains a series of useful extension methods. To use simple add a “using” statement using VisioAutomation.Extensions;
Examples
Methods like DropManyU don't return Shape objects but rather their IDs. If you want to quickly get the shape objects from a list of shape IDs then .Shapes.GetShapesFromIDs can be used.
Visio aready has a Page.ResizeToFitContents() method but this extension method makes it easy to ensure a width and height for the margins
Fonts.AsEnumerable()
Sometimes one needs to keep looking up the ID of a font. By creating a dictionary, you can perform the lookup once and cache the results.
Last updated