|
|
|
|
@ -67,6 +67,9 @@ namespace ICSharpCode.SharpDevelop.Editor
@@ -67,6 +67,9 @@ namespace ICSharpCode.SharpDevelop.Editor
|
|
|
|
|
{ |
|
|
|
|
if (alreadyCalled) { |
|
|
|
|
alreadyCalled = false; |
|
|
|
|
// thread-safety: copy delegate reference into local variable
|
|
|
|
|
var actions = this.actions; |
|
|
|
|
if (actions != null) |
|
|
|
|
actions(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -90,12 +93,14 @@ namespace ICSharpCode.SharpDevelop.Editor
@@ -90,12 +93,14 @@ namespace ICSharpCode.SharpDevelop.Editor
|
|
|
|
|
public static RepoChangeWatcher AddWatch(string repositoryRoot, Action action) |
|
|
|
|
{ |
|
|
|
|
RepoChangeWatcher watcher; |
|
|
|
|
lock (watchers) { |
|
|
|
|
if (!watchers.TryGetValue(repositoryRoot, out watcher)) { |
|
|
|
|
watcher = new RepoChangeWatcher(repositoryRoot); |
|
|
|
|
watchers.Add(repositoryRoot, watcher); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
watcher.actions += action; |
|
|
|
|
} |
|
|
|
|
return watcher; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -103,6 +108,7 @@ namespace ICSharpCode.SharpDevelop.Editor
@@ -103,6 +108,7 @@ namespace ICSharpCode.SharpDevelop.Editor
|
|
|
|
|
|
|
|
|
|
public void ReleaseWatch(Action action) |
|
|
|
|
{ |
|
|
|
|
lock (watchers) { |
|
|
|
|
actions -= action; |
|
|
|
|
if (actions == null && !disposed) { |
|
|
|
|
WorkbenchSingleton.MainWindow.Activated -= MainWindowActivated; |
|
|
|
|
@ -113,3 +119,4 @@ namespace ICSharpCode.SharpDevelop.Editor
@@ -113,3 +119,4 @@ namespace ICSharpCode.SharpDevelop.Editor
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|