File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Rubberduck.VBEEditor/Extensions Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,21 @@ public static class ProjectExtensions
10
10
public static string ProjectName ( this VBProject project )
11
11
{
12
12
var projectName = project . Name ;
13
- var documentModule = project
14
- . VBComponents . Cast < VBComponent > ( )
15
- . FirstOrDefault ( item => item . Type == vbext_ComponentType . vbext_ct_Document ) ;
16
-
17
- if ( documentModule != null )
13
+ if ( project . Protection == vbext_ProjectProtection . vbext_pp_none )
18
14
{
19
- var hostDocumentNameProperty = documentModule . Properties . Item ( "Name" ) ;
20
- if ( hostDocumentNameProperty != null )
15
+ var documentModule = project
16
+ . VBComponents . Cast < VBComponent > ( )
17
+ . FirstOrDefault ( item => item . Type == vbext_ComponentType . vbext_ct_Document ) ;
18
+
19
+ if ( documentModule != null )
21
20
{
22
- projectName += string . Format ( " ({0})" , hostDocumentNameProperty . Value ) ;
21
+ var hostDocumentNameProperty = documentModule . Properties . Item ( "Name" ) ;
22
+ if ( hostDocumentNameProperty != null )
23
+ {
24
+ projectName += string . Format ( " ({0})" , hostDocumentNameProperty . Value ) ;
25
+ }
23
26
}
24
27
}
25
-
26
28
return projectName ;
27
29
}
28
30
You can’t perform that action at this time.
0 commit comments