Browse Source
- don't duplicate search for nested classes in referenced project contents - MemberLookupHelper.GetTypeInheritanceTree: use HashSet instead of List to find duplicate types - DefaultClass.ClassInheritanceTree: cache the inheritance tree Fixes SD2-1460 - Extreme delay requesting code completion for PropertyTabsCollection when Linq is imported git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3573 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
15 changed files with 128 additions and 101 deletions
@ -0,0 +1,45 @@
@@ -0,0 +1,45 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <author name="Daniel Grunwald"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Dom |
||||
{ |
||||
static class DomCache |
||||
{ |
||||
/// <summary>
|
||||
/// Clear the static searchclass cache. You should call this method
|
||||
/// whenever the DOM changes.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// automatically called by DefaultProjectContent.UpdateCompilationUnit
|
||||
/// and DefaultProjectContent.OnReferencedContentsChanged.
|
||||
/// </remarks>
|
||||
public static void Clear() |
||||
{ |
||||
List<Action> oldActions; |
||||
lock (lockObject) { |
||||
oldActions = actions; |
||||
actions = new List<Action>(); |
||||
} |
||||
foreach (Action a in oldActions) { |
||||
a(); |
||||
} |
||||
} |
||||
|
||||
static readonly object lockObject = new Object(); |
||||
static List<Action> actions = new List<Action>(); |
||||
|
||||
public static void RegisterForClear(Action action) |
||||
{ |
||||
lock (lockObject) { |
||||
actions.Add(action); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue