diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj
index 98b28217fe..be68efe0ea 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.csproj
@@ -185,6 +185,7 @@
+
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs
index 58b7e007c6..e374a7d3fa 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs
@@ -27,7 +27,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
Rect neatoInput = transform.NodeToNeatoInput(node);
string dotFormatNode =
- string.Format(formatCulture,
+ string.Format(this.neatoDoubleFormatter,
"{0} [pos=\"{1},{2}!\" width=\"{3}\" height=\"{4}\"];",
nodeName, neatoInput.Location.X, neatoInput.Location.Y, neatoInput.Width, neatoInput.Height);
builder.AppendLine(dotFormatNode);
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotFormatter.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotFormatter.cs
index 3413bbf077..e2ba4e05db 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotFormatter.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/DotFormatter.cs
@@ -23,12 +23,12 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
protected NeatoPositionTransform transform;
+ protected NeatoDoubleFormatter neatoDoubleFormatter = new NeatoDoubleFormatter();
+
// state (node and edge names) needed for parsing back
protected Dictionary nodeNames = new Dictionary();
protected Dictionary edgeNames = new Dictionary();
- protected CultureInfo formatCulture = CultureInfo.GetCultureInfo("en-US");
-
///
/// Used for generating node and edge names.
///
@@ -136,7 +136,7 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
private double readDouble(TextReader reader)
{
- return double.Parse(readWord(reader), formatCulture);
+ return double.Parse(readWord(reader), this.neatoDoubleFormatter.DoubleCulture);
}
private int readInt(TextReader reader)
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoDoubleFormatter.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoDoubleFormatter.cs
new file mode 100644
index 0000000000..3628834ed9
--- /dev/null
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/NeatoDoubleFormatter.cs
@@ -0,0 +1,39 @@
+//
+//
+//
+//
+// $Revision$
+//
+using System;
+using System.Globalization;
+
+namespace Debugger.AddIn.Visualizers.Graph.Layout
+{
+ ///
+ /// When used as IFormatProvider in string.Format, formats doubles to be suitable for Neato.
+ ///
+ public class NeatoDoubleFormatter : IFormatProvider, ICustomFormatter
+ {
+ private CultureInfo doubleCulture = CultureInfo.GetCultureInfo("en-US");
+ ///
+ /// CultureInfo used for formatting and parsing doubles (en-US).
+ ///
+ public CultureInfo DoubleCulture
+ {
+ get { return this.doubleCulture; }
+ }
+
+ public object GetFormat(Type formatType)
+ {
+ if (formatType == typeof(ICustomFormatter))
+ return this;
+ else
+ return null;
+ }
+
+ public string Format(string format, object arg, IFormatProvider formatProvider)
+ {
+ return string.Format(doubleCulture, "{0:0.000}", arg);
+ }
+ }
+}
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs
index d853abafee..fd83305b30 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs
@@ -12,7 +12,7 @@ using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
///
- /// that treats nodes as records of properties.
+ /// that treats nodes as records of properties.
/// Edges start at property, end at node.
///
public class RecordDotFormatter : DotFormatter
@@ -48,9 +48,9 @@ namespace Debugger.AddIn.Visualizers.Graph.Layout
}
string dotFormatNode =
- string.Format(formatCulture,
+ string.Format(this.neatoDoubleFormatter,
"{0} [pos=\"{1},{2}!\" width=\"{3}\" height=\"{4}\" label=\"{5}\"];",
- nodeName,
+ nodeName,
neatoInput.Location.X, neatoInput.Location.Y, neatoInput.Width, neatoInput.Height,
recordLabel.ToString());
builder.AppendLine(dotFormatNode);