[Monodevelop-patches-list] r637 - in trunk/MonoDevelop/src/Main/Base: Gui/Pads/ProjectBrowser Internal/CollectionUtilities

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sat Jan 24 20:27:26 EST 2004


Author: benm
Date: 2004-01-24 20:27:26 -0500 (Sat, 24 Jan 2004)
New Revision: 637

Modified:
   trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
   trunk/MonoDevelop/src/Main/Base/Internal/CollectionUtilities/Comparers.cs
Log:
pick up the pieces

Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs	2004-01-25 01:20:48 UTC (rev 636)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/ProjectBrowserView.cs	2004-01-25 01:27:26 UTC (rev 637)
@@ -411,26 +411,6 @@
 				((AbstractBrowserNode)e.Node).BeforeCollapse();
 			}
 		}
-
-		protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
-		{
-			base.OnAfterLabelEdit(e);
-			AbstractBrowserNode node = (AbstractBrowserNode)e.Node;
-			LabelEdit = false;
-			
-			// we set the label ourself
-			node.AfterLabelEdit(e.Label);
-			
-			e.CancelEdit = true;
-			
-			if(node.Parent != null) {
-				SortUtility.QuickSort(node.Parent.Nodes, TreeNodeComparer.ProjectNode);
-			}
-			
-			// save changes
-			IProjectService projectService = (IProjectService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
-			projectService.SaveCombine();
-		}
 */	
 		
 		//static ImageList projectBrowserImageList  = null;
@@ -515,10 +495,6 @@
 			node.DoDragDrop(e.Data, e.Effect);
 			IProjectService projectService = (IProjectService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
 			
-			if(node.Parent != null) {
-				SortUtility.QuickSort(node.Parent.Nodes, TreeNodeComparer.ProjectNode);
-			}
-			
 			projectService.SaveCombine();
 		}
 */	

Modified: trunk/MonoDevelop/src/Main/Base/Internal/CollectionUtilities/Comparers.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/CollectionUtilities/Comparers.cs	2004-01-25 01:20:48 UTC (rev 636)
+++ trunk/MonoDevelop/src/Main/Base/Internal/CollectionUtilities/Comparers.cs	2004-01-25 01:27:26 UTC (rev 637)
@@ -68,44 +68,8 @@
 
 namespace System.Collections.Specialized
 {
-	///<summary>
-	///Compares TreeNodes by ImageIndex, SelectedImageIndex then Text properties
-	///Intended to be used in sorters that group TreeNodes by their icon and sort them by text
-	///</summary>
-	[Serializable]
-	public class ProjectNodeComparer : IComparer
-	{
-		public int Compare(object x, object y)
-		{
-			if (x.GetType() == y.GetType()) {
-				if (x is NamedFolderNode) {
-					return ((NamedFolderNode)x).SortPriority - ((NamedFolderNode)y).SortPriority;
-				}
-				return ((TreeNode)x).Text.CompareTo(((TreeNode)y).Text);
-			}
-			if (x is FileNode) {
-				return 1;
-			} else if (y is FileNode) {
-				return -1;
-			}
-			if (x is DirectoryNode) {
-				return 1;
-			} else if (y is DirectoryNode) {
-				return -1;
-			}
-			return TreeNodeComparer.Default.Compare(x, y);
-		}
-	}
-	
-	///<summary>
-	///Compares TreeNodes by ImageIndex, SelectedImageIndex then Text properties
-	///Intended to be used in sorters that group TreeNodes by their icon and sort them by text
-	///</summary>
-	[Serializable]
-	public class TreeNodeComparer : IComparer {
+	public class TreeNodeComparer {
 		
-		public static IComparer Default    = new TreeNodeComparer();
-		public static IComparer ProjectNode = new ProjectNodeComparer();
 		public static Gtk.TreeIterCompareFunc GtkProjectNode = new Gtk.TreeIterCompareFunc (GtkProjectNodeComparer);
 		public static Gtk.TreeIterCompareFunc GtkDefault = new Gtk.TreeIterCompareFunc (GtkDefaultComparer);
 			
@@ -142,25 +106,5 @@
 			
 			return x.Text.CompareTo (y.Text);
 		}
-		
-		protected TreeNodeComparer() {}
-		
-		public int Compare(TreeNode x, TreeNode y) {
-			// FIXME
-			//int cmp = x.ImageIndex - y.ImageIndex;
-			//if(cmp == 0) {
-//				cmp = x.SelectedImageIndex - y.SelectedImageIndex;
-//				if(cmp == 0) {
-//					cmp = x.Text.CompareTo(y.Text);
-//				}
-			//}
-			
-//			return cmp;
-			return x.Text.CompareTo(y.Text);
-		}
-		
-		int IComparer.Compare(object x, object y) {
-			return Compare((TreeNode)x, (TreeNode)y);
-		}
 	}
 }




More information about the Monodevelop-patches-list mailing list