Importing rulesets from XML

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

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

Imported rulesets are immediately added to the Rules Explorer tree view.

 public void ImportRuleSets() { try { string title = "RuleSets"; string fileName = ""; Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.Title = "Import " + title; dlg.InitialDirectory = System.Environment.GetFolderPath( ...

Get Microsoft Visio 2013 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.