Skip to content

Commit b2989bd

Browse files
committed
added ModuleStateChanged parser state event
1 parent 3f0edbc commit b2989bd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ private void OnStateChanged()
4040
private readonly ConcurrentDictionary<VBComponent, SyntaxErrorException> _moduleExceptions =
4141
new ConcurrentDictionary<VBComponent, SyntaxErrorException>();
4242

43+
public event EventHandler<ParseProgressEventArgs> ModuleStateChanged;
44+
45+
private void OnModuleStateChanged(VBComponent component)
46+
{
47+
var handler = ModuleStateChanged;
48+
if (handler != null)
49+
{
50+
var args = new ParseProgressEventArgs(component);
51+
handler.Invoke(this, args);
52+
}
53+
}
54+
4355
public void SetModuleState(VBComponent component, ParserState state, SyntaxErrorException parserError = null)
4456
{
4557
_moduleStates[component] = state;
@@ -53,6 +65,7 @@ public void SetModuleState(VBComponent component, ParserState state, SyntaxError
5365
? ParserState.Resolving
5466
: ParserState.Ready;
5567

68+
OnModuleStateChanged(component);
5669
}
5770

5871
public ParserState GetModuleState(VBComponent component)

0 commit comments

Comments
 (0)