aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-07-30 12:42:25 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-07-30 12:42:25 +0200
commit6c6fb760bfb6a956a3413abfb56571a11113acd3 (patch)
tree63bfcb046c0eedbacc6412ed6c03595db3acc557 /src
parentdca4d91d401ba718eccb83d6be42a12f55919838 (diff)
replace ';' separator between members by ',' and set '.' as decimal mark in files
Diffstat (limited to 'src')
-rw-r--r--src/Colors.cs4
-rw-r--r--src/GraphicObjects/GraphicObject.cs18
-rw-r--r--src/Interface.cs11
-rw-r--r--src/Point.cs4
-rw-r--r--src/Rectangle.cs4
-rw-r--r--src/Size.cs2
6 files changed, 30 insertions, 13 deletions
diff --git a/src/Colors.cs b/src/Colors.cs
index 269d7ae6..751fb252 100644
--- a/src/Colors.cs
+++ b/src/Colors.cs
@@ -1012,7 +1012,7 @@ namespace Crow
#region IXmlSerializable
public void ReadXml(System.Xml.XmlReader reader)
{
- string[] c = reader["Color"].Split(new char[] { ';' });
+ string[] c = reader["Color"].Split(new char[] { ',' });
R = double.Parse(c[0]);
G = double.Parse(c[1]);
B = double.Parse(c[2]);
@@ -1061,7 +1061,7 @@ namespace Crow
}
}
- return string.Format("{0};{1};{2};{3}", R, G, B, A);
+ return string.Format("{0},{1},{2},{3}", R, G, B, A);
}
public static object Parse(string s)
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 433599c1..3eaa91f1 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -82,8 +82,8 @@ namespace Crow
protected bool _isVisible = true;
VerticalAlignment _verticalAlignment = VerticalAlignment.Center;
HorizontalAlignment _horizontalAlignment = HorizontalAlignment.Center;
- Size _maximumSize = "0;0";
- Size _minimumSize = "0;0";
+ Size _maximumSize = "0,0";
+ Size _minimumSize = "0,0";
bool cacheEnabled = false;
object dataSource;
string style;
@@ -419,7 +419,7 @@ namespace Crow
NotifyValueChanged ("Visible", _isVisible);
}
}
- [XmlAttributeAttribute()][DefaultValue("1;1")]
+ [XmlAttributeAttribute()][DefaultValue("1,1")]
public virtual Size MinimumSize {
get { return _minimumSize; }
set {
@@ -432,7 +432,7 @@ namespace Crow
RegisterForLayouting (LayoutingType.Sizing);
}
}
- [XmlAttributeAttribute()][DefaultValue("0;0")]
+ [XmlAttributeAttribute()][DefaultValue("0,0")]
public virtual Size MaximumSize {
get { return _maximumSize; }
set {
@@ -539,9 +539,15 @@ namespace Crow
else
name = xaa.AttributeName;
}
- if (styling.ContainsKey (name)) {
- } else {
+ bool memberHasStyle = false;
+ if (styling != null){
+ if (styling.ContainsKey (name))
+ memberHasStyle = true;
+ }
+ if (memberHasStyle){
+
+ }else {
if (name == "Style") {
//retrieve default value from class attribute
//DefaultStyle defStyle = thisType.GetCustomAttribute<DefaultStyle>();
diff --git a/src/Interface.cs b/src/Interface.cs
index d8f66443..2636b60a 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -204,6 +204,9 @@ namespace Crow
}
public static GraphicObject Load (string path, object hostClass = null)
{
+ System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
Interface.XmlLoaderCount ++;
CurrentGOMLPath = path;
GraphicObject tmp = null;
@@ -211,6 +214,9 @@ namespace Crow
tmp = Load(stream, GetTopContainerOfGOMLStream(stream), hostClass);
}
Interface.XmlLoaderCount --;
+
+ Thread.CurrentThread.CurrentCulture = savedCulture;
+
return tmp;
}
public static GraphicObject Load (Stream stream, Type type, object hostClass = null)
@@ -264,12 +270,17 @@ namespace Crow
public Dictionary<string, Dictionary<string, string>> Styling;
public void LoadStyling() {
+ System.Globalization.CultureInfo savedCulture = Thread.CurrentThread.CurrentCulture;
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+
Styling = new Dictionary<string, Dictionary<string, string>> ();
//fetch styling info in this order, if member styling is alreadey referenced in previous
//assembly, it's ignored
loadStylingFromAssembly (Assembly.GetEntryAssembly ());
loadStylingFromAssembly (Assembly.GetExecutingAssembly ());
+
+ Thread.CurrentThread.CurrentCulture = savedCulture;
}
void loadStylingFromAssembly (Assembly assembly) {
diff --git a/src/Point.cs b/src/Point.cs
index 76beaa99..ba0103e3 100644
--- a/src/Point.cs
+++ b/src/Point.cs
@@ -130,7 +130,7 @@ namespace Crow
public override string ToString()
{
- return string.Format("({0};{1})", X, Y);
+ return string.Format("({0},{1})", X, Y);
}
public override bool Equals(object obj)
@@ -145,7 +145,7 @@ namespace Crow
{
if (string.IsNullOrEmpty (s))
return default(Point);
- string[] d = s.Trim().Split(';');
+ string[] d = s.Trim().Split(',');
if (d.Length == 2)
return new Point (int.Parse (d [0]), int.Parse (d [1]));
else if (d.Length == 1) {
diff --git a/src/Rectangle.cs b/src/Rectangle.cs
index e9445224..9a4ef396 100644
--- a/src/Rectangle.cs
+++ b/src/Rectangle.cs
@@ -236,11 +236,11 @@ namespace Crow
}
public override string ToString()
{
- return string.Format("{0};{1};{2};{3}", X, Y, Width, Height);
+ return string.Format("{0},{1},{2},{3}", X, Y, Width, Height);
}
public static Rectangle Parse(string s)
{
- string[] d = s.Split(new char[] { ';' });
+ string[] d = s.Split(new char[] { ',' });
return new Rectangle(
int.Parse(d[0]),
int.Parse(d[1]),
diff --git a/src/Size.cs b/src/Size.cs
index 21ddb539..5059d31a 100644
--- a/src/Size.cs
+++ b/src/Size.cs
@@ -153,7 +153,7 @@ namespace Crow
}
public static Size Parse(string s)
{
- string[] d = s.Split(new char[] { ';' });
+ string[] d = s.Split(new char[] { ',' });
return d.Length == 1 ? new Size(int.Parse(d[0])) : new Size(
int.Parse(d[0]),
int.Parse(d[1]));