Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <marius.ungureanu@xamarin.com>2016-03-27 13:07:40 +0300
committerMarius Ungureanu <marius.ungureanu@xamarin.com>2016-03-27 13:07:40 +0300
commit7fb96582e9f9a14394b654d0ada2e8bf5780364b (patch)
treee6f20a1b071235c48d0b061de42311b5902b86b1 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad
parent18bb88f6c827e470837f239cd695d6af9ec769c8 (diff)
[Ide] Experimental change from single addchild to packing children updates in tree view nodes
This change is going to bring speed improvements after the optimizations done to AppendValues inside Gtk# are released. Batch calls to AddChild, as the collection insertion is guarded against multiple resorts on insertion.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs3
4 files changed, 11 insertions, 16 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs
index 5e76a6bed5..f2f7c8d72a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/CombineNodeBuilder.cs
@@ -62,8 +62,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
{
SolutionFolder combine = (SolutionFolder) dataObject;
if (builder.Options ["ShowProjects"]) {
- foreach (SolutionFolderItem entry in combine.Items)
- builder.AddChild (entry);
+ builder.AddChildren (combine.Items);
} else {
AddClasses (builder, combine);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs
index f1dab068e5..04b331b609 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/NamespaceData.cs
@@ -105,17 +105,15 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
void AddProjectContent (ITreeBuilder builder, Project p)
{
- foreach (var ns in namesp.GetNamespaceMembers ()) {
- if (!builder.HasChild (ns.Name, typeof (NamespaceData)))
- builder.AddChild (new ProjectNamespaceData (project, ns));
- }
+ builder.AddChildren (namesp.GetNamespaceMembers ()
+ .Where (ns => !builder.HasChild (ns.Name, typeof (NamespaceData)))
+ .Select (ns => new ProjectNamespaceData (project, ns)));
// bool nestedNs = builder.Options ["NestedNamespaces"];
bool publicOnly = builder.Options ["PublicApiOnly"];
- foreach (var type in namesp.GetAllTypes ()) {
- if (!publicOnly || type.DeclaredAccessibility == Accessibility.Public)
- builder.AddChild (new ClassData (project, type));
- }
+ builder.AddChildren (namesp.GetAllTypes ()
+ .Where (type => !publicOnly || type.DeclaredAccessibility == Accessibility.Public)
+ .Select (type => new ClassData (project, type)));
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs
index aa52f0245f..e5cdb2278e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/ProjectNodeBuilder.cs
@@ -113,10 +113,9 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
FillNamespaces (builder, project, ns);
}
}
- foreach (var type in dom.Assembly.GlobalNamespace.GetTypeMembers ()) {
- if (!publicOnly || type.DeclaredAccessibility == Microsoft.CodeAnalysis.Accessibility.Public)
- builder.AddChild (new ClassData (project, type));
- }
+ builder.AddChildren (dom.Assembly.GlobalNamespace.GetTypeMembers ()
+ .Where (type => !publicOnly || type.DeclaredAccessibility == Accessibility.Public)
+ .Select (type => new ClassData (project, type)));
}
public static void FillNamespaces (ITreeBuilder builder, Project project, INamespaceSymbol ns)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs
index 424587f0d0..4852a7f502 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ClassPad/SolutionNodeBuilder.cs
@@ -98,8 +98,7 @@ namespace MonoDevelop.Ide.Gui.Pads.ClassPad
public override void BuildChildNodes (ITreeBuilder ctx, object dataObject)
{
Solution solution = (Solution) dataObject;
- foreach (SolutionFolderItem entry in solution.RootFolder.Items)
- ctx.AddChild (entry);
+ ctx.AddChildren (solution.RootFolder.Items);
}
public override bool HasChildNodes (ITreeBuilder builder, object dataObject)