clovett/DgmlPowerTools

Error: Input string was not in a correct format

Opened this issue · 1 comments

Hi!

I find the tool is immensely useful.

The problem I encountered is that for some syntactically valid DGMLs the image generator produces multiple, hard to decipher popup errors. Once the errors are dismissed, the tool creates a perfectly usable image.

The DGML file below has a logically questionable style condition expression that triggers the error. Arguably, the expression is conceptually wrong, as it is comparing a double to a string, and the MaxWidth property is always defined. However, it is syntactically valid DGML and Visual Studio throws no errors when viewing the file.

<?xml version="1.0" encoding="utf-8"?>
<DirectedGraph GraphDirection="LeftToRight" Layout="Sugiyama" ZoomLevel="-1" xmlns="http://schemas.microsoft.com/vs/2009/dgml">
  <Nodes>
	<Node Id="One" Label="One" Category="TreeNode" Background="#FFADD8E6" />
	<Node Id="Two" Label="Two" Category="TreeNode" Background="#FFADD8E6" />
  </Nodes>
  <Links>
	<Link Source="One" Target="Two" IdLink="One__Two" Category="Association" Index="-1202843969" />
  </Links>
  <Styles>
	<Style TargetType="Node" GroupLabel="MaxWidth (HasNotes)">
		<Condition Expression="MaxWidth = 'False'" />
		<Setter Property="MaxWidth" Value="400" />
	</Style>
  </Styles>
</DirectedGraph>

My suggestion would be to add an option to allow ignoring of all non-critical errors.

Cheers,
Janos

Please try this version: https://github.com/clovett/DgmlPowerTools/releases/tag/1.6.0.11

It does not produce any errors on the above sample.