@@ -446,6 +446,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
446
446
// Actionscript context specific
447
447
//
448
448
if ( ASContext . Context . IsFileValid )
449
+ {
449
450
switch ( e . Type )
450
451
{
451
452
case EventType . ProcessArgs :
@@ -480,65 +481,67 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
480
481
if ( command . StartsWith ( "ASCompletion." , StringComparison . Ordinal ) )
481
482
{
482
483
string cmdData = de . Data as string ;
483
- // run MTASC
484
- if ( command == "ASCompletion.CustomBuild" )
484
+ switch ( command )
485
485
{
486
- if ( cmdData != null ) ASContext . Context . RunCMD ( cmdData ) ;
487
- else ASContext . Context . RunCMD ( "" ) ;
488
- e . Handled = true ;
489
- }
486
+ // run MTASC
487
+ case "ASCompletion.CustomBuild" :
488
+ if ( cmdData != null ) ASContext . Context . RunCMD ( cmdData ) ;
489
+ else ASContext . Context . RunCMD ( "" ) ;
490
+ e . Handled = true ;
491
+ break ;
490
492
491
- // build the SWF using MTASC
492
- else if ( command == "ASCompletion.QuickBuild" )
493
- {
494
- ASContext . Context . BuildCMD ( false ) ;
495
- e . Handled = true ;
496
- }
493
+ // build the SWF using MTASC
494
+ case "ASCompletion.QuickBuild" :
495
+ ASContext . Context . BuildCMD ( false ) ;
496
+ e . Handled = true ;
497
+ break ;
497
498
498
- // resolve element under cursor and open declaration
499
- else if ( command == "ASCompletion.GotoDeclaration" )
500
- {
501
- ASComplete . DeclarationLookup ( sci ) ;
502
- e . Handled = true ;
503
- }
499
+ // resolve element under cursor and open declaration
500
+ case "ASCompletion.GotoDeclaration" :
501
+ ASComplete . DeclarationLookup ( sci ) ;
502
+ e . Handled = true ;
503
+ break ;
504
504
505
- // resolve element under cursor and send a CustomData event
506
- else if ( command == "ASCompletion.ResolveElement" )
507
- {
508
- ASComplete . ResolveElement ( sci , cmdData ) ;
509
- e . Handled = true ;
510
- }
511
- else if ( command == "ASCompletion.MakeIntrinsic" )
512
- {
513
- ASContext . Context . MakeIntrinsic ( cmdData ) ;
514
- e . Handled = true ;
515
- }
505
+ // resolve element under cursor and send a CustomData event
506
+ case "ASCompletion.ResolveElement" :
507
+ ASComplete . ResolveElement ( sci , cmdData ) ;
508
+ e . Handled = true ;
509
+ break ;
516
510
517
- // alternative to default shortcuts
518
- else if ( command == "ASCompletion.CtrlSpace" )
519
- {
520
- ASComplete . OnShortcut ( Keys . Control | Keys . Space , ASContext . CurSciControl ) ;
521
- e . Handled = true ;
522
- }
523
- else if ( command == "ASCompletion.CtrlShiftSpace" )
524
- {
525
- ASComplete . OnShortcut ( Keys . Control | Keys . Shift | Keys . Space , ASContext . CurSciControl ) ;
526
- e . Handled = true ;
527
- }
528
- else if ( command == "ASCompletion.CtrlAltSpace" )
529
- {
530
- ASComplete . OnShortcut ( Keys . Control | Keys . Alt | Keys . Space , ASContext . CurSciControl ) ;
531
- e . Handled = true ;
532
- }
533
- else if ( command == "ASCompletion.ContextualGenerator" )
534
- {
535
- if ( ASContext . HasContext && ASContext . Context . IsFileValid )
536
- {
537
- var options = ASGenerator . ContextualGenerator ( ASContext . CurSciControl ) ;
538
- var dataEvent = new DataEvent ( EventType . Command , "ASCompletion.ContextualGenerator.AddOptions" , options ) ;
539
- EventManager . DispatchEvent ( this , dataEvent ) ;
540
- CompletionList . Show ( options , false ) ;
541
- }
511
+ case "ASCompletion.MakeIntrinsic" :
512
+ ASContext . Context . MakeIntrinsic ( cmdData ) ;
513
+ e . Handled = true ;
514
+ break ;
515
+
516
+ // alternative to default shortcuts
517
+ case "ASCompletion.CtrlSpace" :
518
+ ASComplete . OnShortcut ( Keys . Control | Keys . Space , ASContext . CurSciControl ) ;
519
+ e . Handled = true ;
520
+ break ;
521
+
522
+ case "ASCompletion.CtrlShiftSpace" :
523
+ ASComplete . OnShortcut ( Keys . Control | Keys . Shift | Keys . Space , ASContext . CurSciControl ) ;
524
+ e . Handled = true ;
525
+ break ;
526
+
527
+ case "ASCompletion.CtrlAltSpace" :
528
+ ASComplete . OnShortcut ( Keys . Control | Keys . Alt | Keys . Space , ASContext . CurSciControl ) ;
529
+ e . Handled = true ;
530
+ break ;
531
+
532
+ case "ASCompletion.ContextualGenerator" :
533
+ if ( ASContext . HasContext && ASContext . Context . IsFileValid )
534
+ {
535
+ var options = new List < ICompletionListItem > ( ) ;
536
+ ASGenerator . ContextualGenerator ( ASContext . CurSciControl , options ) ;
537
+ EventManager . DispatchEvent ( this , new DataEvent ( EventType . Command , "ASCompletion.ContextualGenerator.AddOptions" , options ) ) ;
538
+ if ( options . Count == 0 )
539
+ {
540
+ PluginBase . MainForm . StatusLabel . Text = TextHelper . GetString ( "Info.NoContextGeneratorCode" ) ;
541
+ }
542
+ CompletionList . Show ( options , false ) ;
543
+ }
544
+ break ;
542
545
}
543
546
}
544
547
return ;
@@ -548,6 +551,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
548
551
ASContext . Context . OnProcessEnd ( procResult ) ;
549
552
break ;
550
553
}
554
+ }
551
555
}
552
556
catch ( Exception ex )
553
557
{
0 commit comments