Displaying the rule for a selected issue
The built-in Issues Window, which is opened from the Diagram Validation group on the PROCESS tab, provides an existing method for a user to select an issue. Therefore we can synchronize the selected rule in the Rules Explorer whenever an issue is selected. This enables the rules developer to analyze the expressions used.
Actually, the Issues window does not cause any events at all but it does select the target shape or page whenever an issue is selected in the window.
Thus, we can use the Application.Window_SelectionChanged()
event to test if the Issues window is open. If it is, then the selected issue ID is sent into the veApplication.SetSelectedIssue()
method:
public void SetSelectedIssue(int? docid, int? issue)
{
if (docid.HasValue && this.VEDocuments.Count() > 0)
{
selectedVEDocument =
this.VEDocuments.Single(doc => doc.ID == docid);
selectedVEDocument.SetSelectedIssue(issue);
}...