Skip to content

Commit

Permalink
Closes #4046
Browse files Browse the repository at this point in the history
  • Loading branch information
mansellan committed Jun 15, 2018
1 parent c5bb40f commit 877c1ee
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Rubberduck.VBEditor.VB6/SafeComWrappers/VB/VBProject.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -63,7 +64,21 @@ public EnvironmentMode Mode
return 0;
}

return (EnvironmentMode) EbMode();
// Note - the value returned by the EbMode function does NOT match with the EbMode enum, hence remapped below.
var ebMode = EbMode();
switch (ebMode)
{
case 0:
return EnvironmentMode.Design;
case 1:
return EnvironmentMode.Run;
case 2:
return EnvironmentMode.Break;
}

// Should never get here
Debug.Assert(false, $"Unexpected value '{ebMode}' returned from EbMode");
return EnvironmentMode.Design;
}
}

Expand Down

0 comments on commit 877c1ee

Please sign in to comment.