]> O.S.I.I.S - jp/crow.git/commitdiff
remove selected item handling (moved into TemplatedGroup) 30/head
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 6 Sep 2016 11:42:33 +0000 (13:42 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Tue, 6 Sep 2016 11:42:33 +0000 (13:42 +0200)
modifié :         src/GraphicObjects/TreeView.cs
renames
modifié :         src/ItemTemplate.cs

src/GraphicObjects/TreeView.cs
src/ItemTemplate.cs

index 0cf2ce0110b0a4371d90301a37e35f6607dc8d6f..b9ab20b6ada47f651b0838596a22eb6ef3c4e3e7 100644 (file)
@@ -30,14 +30,14 @@ namespace Crow
        public class TreeView : TemplatedGroup
        {
                GraphicObject selectedItemContainer = null;
-               Color selBackground;
-               Color selForeground;
                bool isRoot;
 
-
+               #region CTOR
                public TreeView () : base()
                {
                }
+               #endregion
+
                [XmlAttributeAttribute()][DefaultValue(false)]
                public virtual bool IsRoot {
                        get { return isRoot; }
@@ -49,29 +49,6 @@ namespace Crow
                        }
                }
 
-               [XmlAttributeAttribute][DefaultValue("SteelBlue")]//DeepJungleGreen
-               public virtual Color SelectionBackground {
-                       get { return selBackground; }
-                       set {
-                               if (value == selBackground)
-                                       return;
-                               selBackground = value;
-                               NotifyValueChanged ("SelectionBackground", selBackground);
-                               RegisterForRedraw ();
-                       }
-               }
-               [XmlAttributeAttribute][DefaultValue("White")]
-               public virtual Color SelectionForeground {
-                       get { return selForeground; }
-                       set {
-                               if (value == selForeground)
-                                       return;
-                               selForeground = value;
-                               NotifyValueChanged ("SelectionForeground", selForeground);
-                               RegisterForRedraw ();
-                       }
-               }
-
                [XmlIgnore]public override object SelectedItem {
                        get {
                                return selectedItemContainer == null ?
index f760ecee8afa055f36260acc0d3ed7c9ee3fbaa2..310cfb0a633515c02b717f98bc408545833e603b 100644 (file)
@@ -49,9 +49,10 @@ namespace Crow
 
                public void CreateExpandDelegate (TemplatedGroup host){
                        Type dataType = Type.GetType(strDataType);
-                       Type hostType = typeof(TemplatedGroup);//not sure is the best place to put the dyn method
+                       Type tmpGrpType = typeof(TemplatedGroup);
+                       Type hostType = tmpGrpType;//not sure is the best place to put the dyn method
                        Type evtType = typeof(EventHandler);
-                       Type listBoxType = typeof(ListBox);
+
 
                        MethodInfo evtInvoke = evtType.GetMethod ("Invoke");
                        ParameterInfo [] evtParams = evtInvoke.GetParameters ();
@@ -88,7 +89,7 @@ namespace Crow
                        MethodInfo miGetDatas = dataType.GetMethod (fetchMethodName, new Type[] {});
                        il.Emit (OpCodes.Callvirt, miGetDatas);
 
-                       il.Emit (OpCodes.Callvirt, listBoxType.GetProperty("Data").GetSetMethod ());
+                       il.Emit (OpCodes.Callvirt, tmpGrpType.GetProperty("Data").GetSetMethod ());
 
                        il.Emit (OpCodes.Ret);