File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Rubberduck.Core/UI/CodeExplorer/Commands Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ using NLog ;
2
+ using Rubberduck . Navigation . CodeExplorer ;
3
+ using Rubberduck . UI . Command ;
4
+ using Rubberduck . VBEditor . SafeComWrappers ;
5
+
6
+ namespace Rubberduck . UI . CodeExplorer . Commands
7
+ {
8
+ [ CodeExplorerCommand ]
9
+ public class AddPredeclaredClassModuleCommand : CommandBase
10
+ {
11
+ private readonly AddComponentCommand _addComponentCommand ;
12
+
13
+ public AddPredeclaredClassModuleCommand ( AddComponentCommand addComponentCommand ) : base ( LogManager . GetCurrentClassLogger ( ) )
14
+ {
15
+ _addComponentCommand = addComponentCommand ;
16
+ }
17
+
18
+ protected override bool EvaluateCanExecute ( object parameter )
19
+ {
20
+ return _addComponentCommand . CanAddComponent ( parameter as CodeExplorerItemViewModel ) ;
21
+ }
22
+
23
+ protected override void OnExecute ( object parameter )
24
+ {
25
+ _addComponentCommand . AddComponent ( parameter as CodeExplorerItemViewModel , ComponentType . ClassModule ) ;
26
+ }
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments