From: jpbruyere Date: Sun, 7 Feb 2016 18:01:35 +0000 (+0100) Subject: String.Equals ordinal in bindings and color lookup, RegisterForLayouting in Visible... X-Git-Tag: 0.3~39 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=f1b44e126c22b642c274c971d3401e32c189fff2;p=jp%2Fcrow.git String.Equals ordinal in bindings and color lookup, RegisterForLayouting in Visible change --- diff --git a/src/Colors.cs b/src/Colors.cs index ccc42493..7c0a34cf 100644 --- a/src/Colors.cs +++ b/src/Colors.cs @@ -43,7 +43,7 @@ namespace Crow public double B; #endregion - #region Operators + #region Operators public static implicit operator string(Color c) { return c.ToString(); @@ -59,7 +59,7 @@ namespace Crow { foreach (Color cr in ColorDic) { - if (cr.Name == s) + if (string.Equals(cr.Name,s,StringComparison.Ordinal)) return cr; } } diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 4ccef3a5..327d0d05 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -364,15 +364,17 @@ namespace Crow if (HostContainer == null) return; - //add slot to clipping to redraw - HostContainer.gobjsToRedraw.Add (this); +// //add slot to clipping to redraw +// HostContainer.gobjsToRedraw.Add (this); //ensure main win doesn't keep hidden childrens ref - if (this.Contains (HostContainer.hoverWidget)) + if (!_isVisible && this.Contains (HostContainer.hoverWidget)) HostContainer.hoverWidget = null; if (Parent is GenericStack) Parent.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.PositionChildren); - +// + RegisterForLayouting(LayoutingType.Sizing); + RegisterForRedraw (); NotifyValueChanged ("Visible", _isVisible); } } @@ -908,7 +910,7 @@ namespace Crow } MethodInfo stringEquals = typeof(string).GetMethod - ("Compare", new Type[3] {typeof(string), typeof(string), typeof(StringComparison)}); + ("Equals", new Type[3] {typeof(string), typeof(string), typeof(StringComparison)}); Type sourceType = this.GetType(); EventInfo ei = typeof(IValueChange).GetEvent("ValueChanged"); MethodInfo evtInvoke = ei.EventHandlerType.GetMethod ("Invoke"); @@ -1013,7 +1015,7 @@ namespace Crow il.Emit (OpCodes.Ldstr, b.Expression.Split('/').LastOrDefault()); il.Emit (OpCodes.Ldc_I4_4);//StringComparison.Ordinal il.Emit (OpCodes.Callvirt, stringEquals); - il.Emit (OpCodes.Brfalse, jumpTable[i]); + il.Emit (OpCodes.Brtrue, jumpTable[i]); i++; }