aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GraphicObject.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-05 10:58:56 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-05 10:58:56 +0100
commit96bd9ab0c3f03018f90551e685d896bf1743fd36 (patch)
tree4e897d32719ff02c626000c1ee68f971be062e02 /src/GraphicObjects/GraphicObject.cs
parent2d20e043e62bd075b3f5f6c4e4bedb2ab7d910f8 (diff)
use StringComparison.Ordinal for dyn updates in bindings
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
-rw-r--r--src/GraphicObjects/GraphicObject.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index b9b142c0..f32ac30e 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -913,6 +913,9 @@ namespace Crow
}
resolved.Add (b);
}
+
+ MethodInfo stringEquals = typeof(string).GetMethod
+ ("Compare", new Type[3] {typeof(string), typeof(string), typeof(StringComparison)});
//group;only one dynMethods by target (valuechanged event source)
//changed value name tested in switch
IEnumerable<Binding[]> groupedByTarget = resolved.GroupBy (g => g.Target.Instance, g => g, (k, g) => g.ToArray ());
@@ -924,10 +927,6 @@ namespace Crow
DynamicMethod dm = null;
ILGenerator il = null;
- MethodInfo stringEquals = typeof(string).GetMethod
- ("op_Equality", new Type[2] {typeof(string), typeof(string)});
-
-
System.Reflection.Emit.Label[] jumpTable = null;
System.Reflection.Emit.Label endMethod = new System.Reflection.Emit.Label();
@@ -1018,8 +1017,9 @@ namespace Crow
il.Emit (OpCodes.Ldstr, b.Target.Member.Name);
else
il.Emit (OpCodes.Ldstr, b.Expression.Split('/').LastOrDefault());
+ il.Emit (OpCodes.Ldc_I4_4);//StringComparison.Ordinal
il.Emit (OpCodes.Callvirt, stringEquals);
- il.Emit (OpCodes.Brtrue, jumpTable[i]);
+ il.Emit (OpCodes.Brfalse, jumpTable[i]);
i++;
}