@@ -52,20 +52,12 @@ public bool CanExecuteForNode(ICodeExplorerNode model)
5252
5353 private bool SpecialEvaluateCanExecute ( object parameter )
5454 {
55- try
55+ if ( parameter is System . ValueTuple < string , ICodeExplorerNode > data )
5656 {
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 ) ;
6858 }
59+
60+ return false ;
6961 }
7062
7163 private bool EvaluateCanExecute ( ICodeExplorerNode node )
@@ -77,16 +69,8 @@ private bool EvaluateCanExecute(ICodeExplorerNode node)
7769 return false ;
7870 }
7971
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 ) ;
9074 }
9175
9276 protected override void OnExecute ( object parameter )
@@ -96,27 +80,20 @@ protected override void OnExecute(object parameter)
9680 return ;
9781 }
9882
99- try
83+ if ( ! ( parameter is System . ValueTuple < string , ICodeExplorerNode > data ) )
10084 {
101- if ( ! ( parameter is System . ValueTuple < string , ICodeExplorerNode > data ) )
102- {
103- return ;
104- }
105-
106- var ( templateName , node ) = data ;
85+ return ;
86+ }
10787
108- if ( string . IsNullOrWhiteSpace ( templateName ) || ! ( node is CodeExplorerItemViewModel model ) )
109- {
110- return ;
111- }
88+ var ( templateName , node ) = data ;
11289
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 ) )
11791 {
118- Logger . Trace ( ex ) ;
92+ return ;
11993 }
94+
95+ var moduleText = GetTemplate ( templateName ) ;
96+ _addComponentService . AddComponentWithAttributes ( model , ComponentType , moduleText ) ;
12097 }
12198
12299 private string GetTemplate ( string name )
0 commit comments