Importing rule sets from XML

This method first requests the user to select the XML file (it can be in the standard Visio XML file format too) that contains the rule or rule sets to import from. It then iterates through the rule set and rule elements to add them to the selected VEDocument.

If it encounters a rule set with the same name as an existing rule set in the selected VEDocument, then the user is prompted to overwrite or not.

Imported rule sets are immediately added to the Rules Explorer tree view.

public void ImportRuleSets() { try { string title = "RuleSets"; string shortName = System.IO.Path.GetFileNameWithoutExtension( this.document.FullName); string fileName = System.IO.Path.Combine( this.document.Path, shortName + ".xml"); Microsoft.Win32.OpenFileDialog ...

Get Microsoft Visio 2010 Business Process Diagramming and Validation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.