[longomatch] Fix doubles serialization using the InvariantInfo



commit 4917e0d74acebb7e24697071e7a8d2be016add52
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Sep 15 17:13:15 2014 +0200

    Fix doubles serialization using the InvariantInfo

 LongoMatch.Core/Common/Serializer.cs |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Core/Common/Serializer.cs b/LongoMatch.Core/Common/Serializer.cs
index 08f8b71..f42b668 100644
--- a/LongoMatch.Core/Common/Serializer.cs
+++ b/LongoMatch.Core/Common/Serializer.cs
@@ -147,7 +147,9 @@ namespace LongoMatch.Core.Common
                        } else if (value is Point) {
                                Point p = value as Point;
                                if (p != null) {
-                                       writer.WriteValue(String.Format ("{0} {1}", p.X, p.Y));
+                                       writer.WriteValue(String.Format ("{0} {1}",
+                                                                        p.X.ToString 
(NumberFormatInfo.InvariantInfo),
+                                                                        p.Y.ToString 
(NumberFormatInfo.InvariantInfo)));
                                }
                        }
                }
@@ -172,7 +174,8 @@ namespace LongoMatch.Core.Common
                                        return new HotKey {Key = int.Parse(hk[0]), Modifier = 
int.Parse(hk[1])};
                                } else if (objectType == typeof (Point)) {
                                        string[] ps = ((string)reader.Value).Split (' '); 
-                                       return new Point (double.Parse(ps[0]), double.Parse(ps[1]));
+                                       return new Point (double.Parse(ps[0], NumberFormatInfo.InvariantInfo),
+                                                         double.Parse(ps[1], 
NumberFormatInfo.InvariantInfo));
                                }
                        }
                        return null;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]