Author: mkrueger
Date: 2007-09-05 08:38:47 -0400 (Wed, 05 Sep 2007)
New Revision: 85356

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/NodeState.cs
Log:
* MonoDevelop.Ide.Gui.Pads/NodeState.cs: Fixed little issue in
  NodeState.

Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog        2007-09-05 
12:32:04 UTC (rev 85355)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog        2007-09-05 
12:38:47 UTC (rev 85356)
@@ -1,5 +1,9 @@
 2007-09-05  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * MonoDevelop.Ide.Gui.Pads/NodeState.cs: Fixed little issue in 
NodeState.
+
+2007-09-05  Mike Krüger <[EMAIL PROTECTED]> 
+
        * MonoDevelop.Ide.Gui.Pads/TreeViewPad.cs,
          MonoDevelop.Ide.Gui.Pads/NodeState.cs, 
MonoDevelop.Ide.Gui/Document.cs,
          MonoDevelop.Ide.Gui/ProjectOperations.cs,

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/NodeState.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/NodeState.cs
    2007-09-05 12:32:04 UTC (rev 85355)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/NodeState.cs
    2007-09-05 12:38:47 UTC (rev 85356)
@@ -44,7 +44,7 @@
                TreeViewPad.TreeOptions options;
                
                List<NodeState> childrenState;
-               
+
                public string NodeName {
                        get {
                                return nodeName;
@@ -155,6 +155,8 @@
                                        result.Options [reader.GetAttribute 
("id")] = bool.Parse (reader.GetAttribute ("value"));
                                        return true;
                                case "Node":
+                                       if (result.ChildrenState == null)
+                                               result.ChildrenState = new 
List<MonoDevelop.Ide.Gui.Pads.NodeState> ();
                                        result.ChildrenState.Add 
((NodeState)ReadFrom (reader, result.Options != null ? result.Options : 
parentOptions));
                                        return true;
                                }
@@ -203,14 +205,25 @@
                                return null;
                }
                
+               public override string ToString ()
+               {
+                       return String.Format ("[NodeState: NodeName={0}, 
Expanded={1}, Selected={2}, Options={3}, #ChildrenState={4}]",
+                                             this.nodeName,
+                                             this.expanded,
+                                             this.selected,
+                                             this.options != null ? 
this.options : "null",
+                                             this.childrenState != null ? 
this.childrenState.Count.ToString () : "null");
+               }
+                
                internal static void RestoreState (TreeViewPad pad, 
ITreeNavigator nav, NodeState es)
                {
-                       if (es == null) return;
-
+                       if (es == null) 
+                               return;
+                       
                        Gtk.TreeIter it = nav.CurrentPosition._iter;
-                       if (es.Options != null) {
+                       if (es.Options != null) 
                                pad.SetIterOptions (it, es.Options);
-                       }
+                       
                        pad.ResetState (it);
                        nav.Expanded = es.Expanded;
                        

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to