From 5660677750ae5e11e2b3b3ae642b283dc74b5326 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 19 Mar 2011 22:07:07 +0100 Subject: [PATCH] Add InsertAfter/InsertBefore to AstNodeCollection. --- ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs | 10 ++++++++++ ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs | 2 +- .../TypeSystem/ITypeResolveContext.cs | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs b/ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs index a8c11cb993..98beaeaefb 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/AstNodeCollection.cs @@ -193,5 +193,15 @@ namespace ICSharpCode.NRefactory.CSharp } return false; } + + public void InsertAfter(T existingItem, T newItem) + { + node.InsertChildAfter(existingItem, newItem, role); + } + + public void InsertBefore(T existingItem, T newItem) + { + node.InsertChildBefore(existingItem, newItem, role); + } } } diff --git a/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs b/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs index 74cbdb91ce..26d79e4a9b 100644 --- a/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs +++ b/ICSharpCode.NRefactory/TypeSystem/CecilLoader.cs @@ -35,7 +35,7 @@ namespace ICSharpCode.NRefactory.TypeSystem public bool IncludeInternalMembers { get; set; } /// - /// Gets/Sets the documentation provider that is used to retrive the XML documentation for all members. + /// Gets/Sets the documentation provider that is used to retrieve the XML documentation for all members. /// public IDocumentationProvider DocumentationProvider { get; set; } diff --git a/ICSharpCode.NRefactory/TypeSystem/ITypeResolveContext.cs b/ICSharpCode.NRefactory/TypeSystem/ITypeResolveContext.cs index 3c89b13ade..9cdfb4133d 100644 --- a/ICSharpCode.NRefactory/TypeSystem/ITypeResolveContext.cs +++ b/ICSharpCode.NRefactory/TypeSystem/ITypeResolveContext.cs @@ -44,7 +44,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// Language-specific rules for how namespace names are compared /// List of classes within that namespace. /// - /// If this method is called within using (pc.Synchronize()), then the returned enumerable is valid + /// If this method is called within using (var spc = pc.Synchronize()), then the returned enumerable is valid /// only until the end of the synchronize block. /// IEnumerable GetClasses(string nameSpace, StringComparer nameComparer); @@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.TypeSystem /// Retrieves all namespaces. /// /// - /// If this method is called within using (pc.Synchronize()), then the returned enumerable is valid + /// If this method is called within using (var spc = pc.Synchronize()), then the returned enumerable is valid /// only until the end of the synchronize block. /// IEnumerable GetNamespaces();