File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Rubberduck.Core/UI/CodeExplorer/Commands Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 2
2
using Rubberduck . Navigation . CodeExplorer ;
3
3
using Rubberduck . UI . Command ;
4
4
using Rubberduck . VBEditor . SafeComWrappers ;
5
+ using System . IO ;
5
6
6
7
namespace Rubberduck . UI . CodeExplorer . Commands
7
8
{
@@ -22,7 +23,25 @@ protected override bool EvaluateCanExecute(object parameter)
22
23
23
24
protected override void OnExecute ( object parameter )
24
25
{
25
- _addComponentCommand . AddComponent ( parameter as CodeExplorerItemViewModel , ComponentType . ClassModule ) ;
26
+ string moduleText = CreatePreclaredClassModule ( ) ;
27
+ _addComponentCommand . AddComponent ( parameter as CodeExplorerItemViewModel , moduleText ) ;
28
+ }
29
+
30
+ private string CreatePreclaredClassModule ( )
31
+ {
32
+ string moduleText = @"
33
+ VERSION 1.0 CLASS
34
+ BEGIN
35
+ MultiUse = -1 'True
36
+ END
37
+ Attribute VB_GlobalNameSpace = False
38
+ Attribute VB_Creatable = False
39
+ Attribute VB_PredeclaredId = True
40
+ Attribute VB_Exposed = False
41
+ Attribute VB_Ext_KEY = ""Rubberduck"",""Predeclared Class Module""
42
+ Option Explicit
43
+ " ;
44
+ return moduleText ;
26
45
}
27
46
}
28
47
}
You can’t perform that action at this time.
0 commit comments