File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Rubberduck.VBEditor.VB6/SafeComWrappers/VB Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . Diagnostics ;
3
4
using System . Linq ;
4
5
using System . Runtime . InteropServices ;
5
6
using System . Text . RegularExpressions ;
@@ -63,7 +64,20 @@ public EnvironmentMode Mode
63
64
return 0 ;
64
65
}
65
66
66
- return ( EnvironmentMode ) EbMode ( ) ;
67
+ // Note - the value returned by the EbMode function does NOT match with the EnvironmentMode enum, hence remapped below.
68
+ var ebMode = EbMode ( ) ;
69
+ switch ( ebMode )
70
+ {
71
+ case 0 :
72
+ return EnvironmentMode . Design ;
73
+ case 1 :
74
+ return EnvironmentMode . Run ;
75
+ case 2 :
76
+ return EnvironmentMode . Break ;
77
+ default :
78
+ Debug . Assert ( false , $ "Unexpected value '{ ebMode } ' returned from EbMode") ;
79
+ return EnvironmentMode . Design ;
80
+ }
67
81
}
68
82
}
69
83
You can’t perform that action at this time.
0 commit comments