@@ -22,14 +22,14 @@ namespace Microsoft.CodeTalk.Commands
2222{
2323 public class GetFunctionsCommand : CommandBase
2424 {
25- ResourceManager rm ;
25+ ResourceManager rm ;
2626
2727 public GetFunctionsCommand ( CommandKeyConfig keys ) : base ( keys ) { }
28-
28+
2929 public override void Execute ( )
3030 {
31- rm = new ResourceManager ( typeof ( Resources ) ) ;
32- System . Diagnostics . Debug . WriteLine ( "Get Functions" ) ;
31+ rm = new ResourceManager ( typeof ( Resources ) ) ;
32+ System . Diagnostics . Debug . WriteLine ( "Get Functions" ) ;
3333
3434 IEnumerable < ISyntaxEntity > functions = new List < ISyntaxEntity > ( ) ;
3535 CodeFile codeFile ;
@@ -47,8 +47,8 @@ public override void Execute()
4747 }
4848 catch ( CodeTalkLanguageServiceException )
4949 {
50- MessageBox . Show ( rm . GetString ( "CompilationErrorMessage" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
51- return ;
50+ MessageBox . Show ( rm . GetString ( "CompilationErrorMessage" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
51+ return ;
5252 }
5353
5454 //Creating a function collector for getting all the functions
@@ -60,8 +60,8 @@ public override void Execute()
6060
6161 if ( 0 == functions . Count ( ) )
6262 {
63- MessageBox . Show ( rm . GetString ( "NoFunctionsString" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK ) ;
64- return ;
63+ MessageBox . Show ( rm . GetString ( "NoFunctionsString" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK ) ;
64+ return ;
6565 }
6666
6767 ToolWindowPane listFunctionsWindow = TalkCodePackage . currentPackage . FindToolWindow ( typeof ( AccessibilityToolWindow ) , 0 , true ) ;
@@ -72,31 +72,31 @@ public override void Execute()
7272 }
7373
7474 IVsWindowFrame windowFrame = ( IVsWindowFrame ) listFunctionsWindow . Frame ;
75- windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "FunctionsListTitle" , CultureInfo . CurrentCulture ) ) ;
75+ windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "FunctionsListTitle" , CultureInfo . CurrentCulture ) ) ;
7676
77- Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
77+ Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
7878
79- ( listFunctionsWindow as AccessibilityToolWindow ) . windowControl . SetListView ( functions , rm . GetString ( "FunctionsListTitle" , CultureInfo . CurrentCulture ) ) ;
80- }
79+ ( listFunctionsWindow as AccessibilityToolWindow ) . windowControl . SetListView ( functions , rm . GetString ( "FunctionsListTitle" , CultureInfo . CurrentCulture ) ) ;
80+ }
8181
8282 public override bool PassControl ( ) => false ;
8383 }
8484
8585 public class GetContextCommand : CommandBase
8686 {
87- ResourceManager rm ;
87+ ResourceManager rm ;
8888
89- public GetContextCommand ( CommandKeyConfig keys ) : base ( keys ) { }
89+ public GetContextCommand ( CommandKeyConfig keys ) : base ( keys ) { }
9090
9191 public override bool PassControl ( )
9292 {
9393 return false ;
9494 }
9595 public override void Execute ( )
9696 {
97- rm = new ResourceManager ( typeof ( Resources ) ) ;
97+ rm = new ResourceManager ( typeof ( Resources ) ) ;
9898
99- CodeFile codeFile ;
99+ CodeFile codeFile ;
100100 IList < ISyntaxEntity > contextHierarchy ;
101101
102102 //Getting the code text from the active document
@@ -112,8 +112,8 @@ public override void Execute()
112112 }
113113 catch ( CodeTalkLanguageServiceException )
114114 {
115- MessageBox . Show ( rm . GetString ( "CompilationErrorMessage" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
116- return ;
115+ MessageBox . Show ( rm . GetString ( "CompilationErrorMessage" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
116+ return ;
117117 }
118118 try
119119 {
@@ -124,8 +124,8 @@ public override void Execute()
124124
125125 if ( 0 == contextHierarchy . Count )
126126 {
127- MessageBox . Show ( rm . GetString ( "NoContextString" , CultureInfo . CurrentCulture ) + " " + currentLineNumber . ToString ( ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK ) ;
128- return ;
127+ MessageBox . Show ( rm . GetString ( "NoContextString" , CultureInfo . CurrentCulture ) + " " + currentLineNumber . ToString ( ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK ) ;
128+ return ;
129129 }
130130
131131 var entities = contextHierarchy . Reverse ( ) . ToList ( ) . ConvertAll ( x => ( ISyntaxEntity ) x ) ;
@@ -134,16 +134,16 @@ public override void Execute()
134134
135135 if ( ( null == listFunctionsWindow ) || ( null == listFunctionsWindow . Frame ) )
136136 {
137- MessageBox . Show ( "Cannote create tool window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
137+ MessageBox . Show ( "Cannote create tool window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
138138 }
139139
140140 IVsWindowFrame windowFrame = ( IVsWindowFrame ) listFunctionsWindow . Frame ;
141- windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "GetContextTitle" , CultureInfo . CurrentCulture ) ) ;
141+ windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "GetContextTitle" , CultureInfo . CurrentCulture ) ) ;
142142
143- Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
143+ Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
144144
145- ( listFunctionsWindow as AccessibilityToolWindow ) . windowControl . SetListView ( entities , rm . GetString ( "GetContextTitle" , CultureInfo . CurrentCulture ) , false ) ;
146- }
145+ ( listFunctionsWindow as AccessibilityToolWindow ) . windowControl . SetListView ( entities , rm . GetString ( "GetContextTitle" , CultureInfo . CurrentCulture ) , false ) ;
146+ }
147147 catch ( IndexOutOfRangeException )
148148 {
149149 MessageBox . Show ( "The cursor does not seem to be in code. please move the cursor and try again." , "CodeTalk" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
@@ -165,14 +165,14 @@ public override void Execute()
165165
166166 public class GetErrorsCommand : CommandBase
167167 {
168- ResourceManager rm ;
168+ ResourceManager rm ;
169169
170- public GetErrorsCommand ( CommandKeyConfig keys ) : base ( keys ) { }
170+ public GetErrorsCommand ( CommandKeyConfig keys ) : base ( keys ) { }
171171
172172 public override void Execute ( )
173173 {
174- rm = new ResourceManager ( typeof ( Resources ) ) ;
175- System . Diagnostics . Debug . WriteLine ( "Get Errors" ) ;
174+ rm = new ResourceManager ( typeof ( Resources ) ) ;
175+ System . Diagnostics . Debug . WriteLine ( "Get Errors" ) ;
176176
177177 var errors = new List < ISyntaxEntity > ( ) ;
178178
@@ -190,26 +190,26 @@ public override void Execute()
190190 {
191191 System . Threading . Tasks . Task . Run ( ( ) =>
192192 {
193- MessageBox . Show ( rm . GetString ( "NoErrorsString" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK ) ;
194- } ) ;
193+ MessageBox . Show ( rm . GetString ( "NoErrorsString" , CultureInfo . CurrentCulture ) , rm . GetString ( "CodeTalkString" , CultureInfo . CurrentCulture ) , MessageBoxButtons . OK ) ;
194+ } ) ;
195195 return ;
196196 }
197197
198198 ToolWindowPane listFunctionsWindow = TalkCodePackage . currentPackage . FindToolWindow ( typeof ( AccessibilityToolWindow ) , 0 , true ) ;
199199
200200 if ( ( null == listFunctionsWindow ) || ( null == listFunctionsWindow . Frame ) )
201201 {
202- MessageBox . Show ( "Cannote create tool window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
203- }
204- else
205- {
206- IVsWindowFrame windowFrame = ( IVsWindowFrame ) listFunctionsWindow . Frame ;
207- windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "ErrorListTitle" , CultureInfo . CurrentCulture ) ) ;
202+ MessageBox . Show ( "Cannote create tool window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
203+ }
204+ else
205+ {
206+ IVsWindowFrame windowFrame = ( IVsWindowFrame ) listFunctionsWindow . Frame ;
207+ windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "ErrorListTitle" , CultureInfo . CurrentCulture ) ) ;
208208
209- Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
209+ Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
210210
211- ( listFunctionsWindow as AccessibilityToolWindow ) . windowControl . SetListView ( errors , rm . GetString ( "ErrorListTitle" , CultureInfo . CurrentCulture ) ) ;
212- }
211+ ( listFunctionsWindow as AccessibilityToolWindow ) . windowControl . SetListView ( errors , rm . GetString ( "ErrorListTitle" , CultureInfo . CurrentCulture ) ) ;
212+ }
213213
214214
215215 }
@@ -219,14 +219,14 @@ public override void Execute()
219219
220220 public class GetSummaryCommand : CommandBase
221221 {
222- ResourceManager rm ;
222+ ResourceManager rm ;
223223
224- public GetSummaryCommand ( CommandKeyConfig keys ) : base ( keys ) { }
224+ public GetSummaryCommand ( CommandKeyConfig keys ) : base ( keys ) { }
225225
226226 public override void Execute ( )
227227 {
228- rm = new ResourceManager ( typeof ( Resources ) ) ;
229- System . Diagnostics . Debug . WriteLine ( "Get Summary" ) ;
228+ rm = new ResourceManager ( typeof ( Resources ) ) ;
229+ System . Diagnostics . Debug . WriteLine ( "Get Summary" ) ;
230230
231231 //Getting the code text from the active document
232232 var path = TalkCodePackage . vsOperations . GetActiveDocumentPath ( ) ;
@@ -244,22 +244,22 @@ public override void Execute()
244244
245245 if ( ( null == listFunctionsWindow ) || ( null == listFunctionsWindow . Frame ) )
246246 {
247- MessageBox . Show ( "Cannote create tool window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
248- }
249- else
250- {
251- IVsWindowFrame windowFrame = ( IVsWindowFrame ) listFunctionsWindow . Frame ;
252- windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "FileSummaryTitle" , CultureInfo . CurrentCulture ) ) ;
253- Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
254-
255- ( listFunctionsWindow as GetSummaryToolWindow ) . windowControl . SetTreeView ( codeFile , rm . GetString ( "FileSSummaryTitle" , CultureInfo . CurrentCulture ) ) ;
256- }
247+ MessageBox . Show ( "Cannote create tool window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
248+ }
249+ else
250+ {
251+ IVsWindowFrame windowFrame = ( IVsWindowFrame ) listFunctionsWindow . Frame ;
252+ windowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "FileSummaryTitle" , CultureInfo . CurrentCulture ) ) ;
253+ Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( windowFrame . Show ( ) ) ;
254+
255+ ( listFunctionsWindow as GetSummaryToolWindow ) . windowControl . SetTreeView ( codeFile , rm . GetString ( "FileSSummaryTitle" , CultureInfo . CurrentCulture ) ) ;
256+ }
257257
258258 }
259259 catch ( CodeTalkLanguageServiceException )
260260 {
261- MessageBox . Show ( rm . GetString ( "FileProcessError" , CultureInfo . CurrentCulture ) ) ;
262- }
261+ MessageBox . Show ( rm . GetString ( "FileProcessError" , CultureInfo . CurrentCulture ) ) ;
262+ }
263263 }
264264
265265 public override bool PassControl ( ) => false ;
@@ -268,31 +268,30 @@ public override void Execute()
268268
269269 public class CreateBreakpointCommand : CommandBase
270270 {
271- ResourceManager rm ;
271+ ResourceManager rm ;
272272
273- public CreateBreakpointCommand ( CommandKeyConfig keys ) : base ( keys ) { }
273+ public CreateBreakpointCommand ( CommandKeyConfig keys ) : base ( keys ) { }
274274
275275 public override void Execute ( )
276276 {
277- rm = new ResourceManager ( typeof ( Resources ) ) ;
278- Debug . WriteLine ( "Create Breakpoint" ) ;
277+ rm = new ResourceManager ( typeof ( Resources ) ) ;
279278
280279 if ( TalkCodePackage . vsOperations . RemoveBreakpointIfExists ( ) ) { return ; }
281280
282281 ToolWindowPane talkpointWindow = TalkCodePackage . currentPackage . FindToolWindow ( typeof ( TalkpointToolWindow ) , 0 , true ) ;
283282
284283 if ( ( null == talkpointWindow ) || ( null == talkpointWindow . Frame ) )
285284 {
286- MessageBox . Show ( "Cannote create breakpoint window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
287- }
288- else
289- {
290- IVsWindowFrame twindowFrame = ( IVsWindowFrame ) talkpointWindow . Frame ;
291- twindowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "TalkPointWindowTitle" , CultureInfo . CurrentCulture ) ) ;
292-
293- Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( twindowFrame . Show ( ) ) ;
294- ( ( talkpointWindow as TalkpointToolWindow ) . Content as TalkpointToolWindowControl ) . ClearAll ( ) ;
295- }
285+ MessageBox . Show ( "Cannote create breakpoint window" , "Cannot create tool window" , MessageBoxButtons . OK ) ;
286+ }
287+ else
288+ {
289+ IVsWindowFrame twindowFrame = ( IVsWindowFrame ) talkpointWindow . Frame ;
290+ twindowFrame . SetProperty ( ( int ) __VSFPROPID . VSFPROPID_Caption , rm . GetString ( "TalkPointWindowTitle" , CultureInfo . CurrentCulture ) ) ;
291+
292+ Microsoft . VisualStudio . ErrorHandler . ThrowOnFailure ( twindowFrame . Show ( ) ) ;
293+ ( ( talkpointWindow as TalkpointToolWindow ) . Content as TalkpointToolWindowControl ) . ClearAll ( ) ;
294+ }
296295 }
297296
298297 public override bool PassControl ( ) => false ;
0 commit comments