@@ -8,20 +8,26 @@ public class VBProjectsEventsSink : _dispVBProjectsEvents
8
8
public event EventHandler < DispatcherEventArgs < VBProject > > ProjectAdded ;
9
9
public void ItemAdded ( VBProject VBProject )
10
10
{
11
- OnDispatch ( ProjectAdded , VBProject ) ;
11
+ if ( VBProject . Protection == vbext_ProjectProtection . vbext_pp_none )
12
+ {
13
+ OnDispatch ( ProjectAdded , VBProject ) ;
14
+ }
12
15
}
13
16
14
17
public event EventHandler < DispatcherEventArgs < VBProject > > ProjectRemoved ;
15
18
public void ItemRemoved ( VBProject VBProject )
16
19
{
17
- OnDispatch ( ProjectRemoved , VBProject ) ;
20
+ if ( VBProject . Protection == vbext_ProjectProtection . vbext_pp_none )
21
+ {
22
+ OnDispatch ( ProjectRemoved , VBProject ) ;
23
+ }
18
24
}
19
25
20
26
public event EventHandler < DispatcherRenamedEventArgs < VBProject > > ProjectRenamed ;
21
27
public void ItemRenamed ( VBProject VBProject , string OldName )
22
28
{
23
29
var handler = ProjectRenamed ;
24
- if ( handler != null )
30
+ if ( handler != null && VBProject . Protection == vbext_ProjectProtection . vbext_pp_none )
25
31
{
26
32
handler . Invoke ( this , new DispatcherRenamedEventArgs < VBProject > ( VBProject , OldName ) ) ;
27
33
}
@@ -30,7 +36,10 @@ public void ItemRenamed(VBProject VBProject, string OldName)
30
36
public event EventHandler < DispatcherEventArgs < VBProject > > ProjectActivated ;
31
37
public void ItemActivated ( VBProject VBProject )
32
38
{
33
- OnDispatch ( ProjectActivated , VBProject ) ;
39
+ if ( VBProject . Protection == vbext_ProjectProtection . vbext_pp_none )
40
+ {
41
+ OnDispatch ( ProjectActivated , VBProject ) ;
42
+ }
34
43
}
35
44
36
45
private void OnDispatch ( EventHandler < DispatcherEventArgs < VBProject > > dispatched , VBProject project )
0 commit comments