Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Shared/Audio/DebugEntry.wav
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\Shared\Audio\DebugEntry.wav">
<Link>Audio\DebugEntry.wav</Link>
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Shared\Audio\Exception.wav">
<Link>Audio\Exception.wav</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ public enum IDEEventType
[IDEEventSource(IDEEventSourceType.DteEvent)]
[Name(Consts.OptionsEnableAudioExceptionDescription)]
Exception = 7,
[IDEEventSource(IDEEventSourceType.DteEvent)]
[Name(Consts.OptionsEnableAudioEntryDebugModeDescription)]
DebugEntry = 8,
}
}
3 changes: 3 additions & 0 deletions djfoxer.VisualStudio.MakeTheSound.Shared/Helper/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ public static class Consts

public const string OptionsEnableAudioFileSaveAllText = "Enable save all files";
public const string OptionsEnableAudioFileSaveAllDescription = "Save all files sound effect";

public const string OptionsEnableAudioEntryDebugMode = "Enable entry debug mode";
public const string OptionsEnableAudioEntryDebugModeDescription = "Entry debug mode";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
using Microsoft.VisualStudio.Shell;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO.Packaging;
using System.Linq;
using System.Management.Instrumentation;
using System.Reflection;
using System.Threading.Tasks;

Expand Down Expand Up @@ -49,6 +51,7 @@ public async Task<MakeTheSoundEventCatcher> InitAsync(AsyncPackage package, Opti

_dte = (DTE2)await _package.GetServiceAsync(typeof(DTE));
Assumes.Present(_dte);


_events = _dte.Events as Events2;
_buildEvents = _events.BuildEvents;
Expand All @@ -60,6 +63,7 @@ public async Task<MakeTheSoundEventCatcher> InitAsync(AsyncPackage package, Opti
await AddActionAsync(IDEEventType.Building);
await AddActionAsync(IDEEventType.Breakepoint);
await AddActionAsync(IDEEventType.Exception);
await AddActionAsync(IDEEventType.DebugEntry);

return this;
}
Expand All @@ -82,16 +86,27 @@ private async System.Threading.Tasks.Task AddActionAsync(IDEEventType iDEEventTy
}
else if (iDEEventType == IDEEventType.Breakepoint)
{
_debuggerEvents.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode; ;
_debuggerEvents.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode;
}
else if (iDEEventType == IDEEventType.DebugEntry)
{
_debuggerEvents.OnEnterRunMode += _debuggerEvents_OnEnterRunMode;
}
else if (iDEEventType == IDEEventType.Exception)
{
_debuggerEvents.OnExceptionNotHandled += DebuggerEvents_OnExceptionNotHandled;
_debuggerEvents.OnExceptionThrown += DebuggerEvents_OnExceptionThrown; ;
_debuggerEvents.OnExceptionThrown += DebuggerEvents_OnExceptionThrown;
}


}
}

private void _debuggerEvents_OnEnterRunMode(dbgEventReason Reason)
{
SetSoundForSingleEvent(IDEEventType.DebugEntry, false);
}

private void DebuggerEvents_OnExceptionThrown(string ExceptionType, string Name, int Code, string Description, ref dbgExceptionAction ExceptionAction)
{
SetSoundForSingleEvent(IDEEventType.Exception, false);
Expand Down
15 changes: 15 additions & 0 deletions djfoxer.VisualStudio.MakeTheSound.Shared/Options/OptionsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ public bool EnableAudioBreakpoint
}
}

[Category(Consts.OptionSubmenu)]
[DisplayName(Consts.OptionsEnableAudioEntryDebugMode)]
[Description(Consts.OptionsEnableAudioEntryDebugModeDescription)]
public bool EnableAudioEntryDebugMode
{
get
{
return _eventTypeConfig[IDEEventType.DebugEntry].IsEnabled;
}
set
{
_eventTypeConfig[IDEEventType.DebugEntry].IsEnabled = value;
}
}

[Category(Consts.OptionSubmenu)]
[DisplayName(Consts.OptionsEnableAudioBuildFailsText)]
[Description(Consts.OptionsEnableAudioBuildFailsDescription)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\Shared\Audio\DebugEntry.wav">
<Link>Audio\DebugEntry.wav</Link>
<IncludeInVSIX>true</IncludeInVSIX>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="..\Shared\Audio\Exception.wav">
<Link>Audio\Exception.wav</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down