@@ -52,20 +52,12 @@ public bool CanExecuteForNode(ICodeExplorerNode model)
52
52
53
53
private bool SpecialEvaluateCanExecute ( object parameter )
54
54
{
55
- try
55
+ if ( parameter is System . ValueTuple < string , ICodeExplorerNode > data )
56
56
{
57
- if ( parameter is System . ValueTuple < string , ICodeExplorerNode > data )
58
- {
59
- return EvaluateCanExecute ( data . Item2 ) ;
60
- }
61
-
62
- return false ;
63
- }
64
- catch ( Exception ex )
65
- {
66
- Logger . Trace ( ex ) ;
67
- return false ;
57
+ return EvaluateCanExecute ( data . Item2 ) ;
68
58
}
59
+
60
+ return false ;
69
61
}
70
62
71
63
private bool EvaluateCanExecute ( ICodeExplorerNode node )
@@ -77,16 +69,8 @@ private bool EvaluateCanExecute(ICodeExplorerNode node)
77
69
return false ;
78
70
}
79
71
80
- try
81
- {
82
- var project = node . Declaration . Project ;
83
- return AllowableProjectTypes . Contains ( project . Type ) ;
84
- }
85
- catch ( COMException exception )
86
- {
87
- Logger . Debug ( exception ) ;
88
- return false ;
89
- }
72
+ var project = node . Declaration . Project ;
73
+ return AllowableProjectTypes . Contains ( project . Type ) ;
90
74
}
91
75
92
76
protected override void OnExecute ( object parameter )
@@ -96,27 +80,20 @@ protected override void OnExecute(object parameter)
96
80
return ;
97
81
}
98
82
99
- try
83
+ if ( ! ( parameter is System . ValueTuple < string , ICodeExplorerNode > data ) )
100
84
{
101
- if ( ! ( parameter is System . ValueTuple < string , ICodeExplorerNode > data ) )
102
- {
103
- return ;
104
- }
105
-
106
- var ( templateName , node ) = data ;
85
+ return ;
86
+ }
107
87
108
- if ( string . IsNullOrWhiteSpace ( templateName ) || ! ( node is CodeExplorerItemViewModel model ) )
109
- {
110
- return ;
111
- }
88
+ var ( templateName , node ) = data ;
112
89
113
- var moduleText = GetTemplate ( templateName ) ;
114
- _addComponentService . AddComponentWithAttributes ( model , ComponentType , moduleText ) ;
115
- }
116
- catch ( Exception ex )
90
+ if ( string . IsNullOrWhiteSpace ( templateName ) || ! ( node is CodeExplorerItemViewModel model ) )
117
91
{
118
- Logger . Trace ( ex ) ;
92
+ return ;
119
93
}
94
+
95
+ var moduleText = GetTemplate ( templateName ) ;
96
+ _addComponentService . AddComponentWithAttributes ( model , ComponentType , moduleText ) ;
120
97
}
121
98
122
99
private string GetTemplate ( string name )
0 commit comments