]> O.S.I.I.S - jp/crow.git/commitdiff
String.Equals ordinal in bindings and color lookup, RegisterForLayouting in Visible...
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Feb 2016 18:01:35 +0000 (19:01 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Feb 2016 18:01:35 +0000 (19:01 +0100)
src/Colors.cs
src/GraphicObjects/GraphicObject.cs

index ccc42493cd99e625768bb796f2a89ae475deed09..7c0a34cff9c65c7a405db92365974561fe509c81 100644 (file)
@@ -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;
                                }
                        }
index 4ccef3a529488bfc03521d67b6c78d4c08f31ff2..327d0d059c1778b95892716b19ac521f09cc461e 100644 (file)
@@ -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++;
                                }