diff --git a/VsDingExtensionFor2012/GlobalSuppressions.cs b/VsDingExtensionFor2012/GlobalSuppressions.cs deleted file mode 100644 index a893f9d..0000000 --- a/VsDingExtensionFor2012/GlobalSuppressions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. Project-level -// suppressions either have no target or are given a specific target -// and scoped to a namespace, type, member, etc. -// -// To add a suppression to this file, right-click the message in the -// Error List, point to "Suppress Message(s)", and click "In Project -// Suppression File". You do not need to add suppressions to this -// file manually. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")] diff --git a/VsDingExtensionFor2012/Guids.cs b/VsDingExtensionFor2012/Guids.cs deleted file mode 100644 index 6362409..0000000 --- a/VsDingExtensionFor2012/Guids.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Guids.cs -// MUST match guids.h - -using System; - -namespace VitaliiGanzha.VsDingExtension -{ - static class GuidList - { - public const string guidVsDingExtensionProjectPkgString = "26ba08d0-0d25-4479-8684-3054dd122876"; - public const string guidVsDingExtensionProjectCmdSetString = "85fa6948-b83a-4626-85da-51b8bb350053"; - - public static readonly Guid guidVsDingExtensionProjectCmdSet = new Guid(guidVsDingExtensionProjectCmdSetString); - }; -} \ No newline at end of file diff --git a/VsDingExtensionFor2012/Resources.Designer.cs b/VsDingExtensionFor2012/Resources.Designer.cs deleted file mode 100644 index d98eab0..0000000 --- a/VsDingExtensionFor2012/Resources.Designer.cs +++ /dev/null @@ -1,90 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18449 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace VitaliiGanzha.VsDingExtension { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VitaliiGanzha.VsDingExtension.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. - /// - internal static System.IO.UnmanagedMemoryStream build { - get { - return ResourceManager.GetStream("build", resourceCulture); - } - } - - /// - /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. - /// - internal static System.IO.UnmanagedMemoryStream debug { - get { - return ResourceManager.GetStream("debug", resourceCulture); - } - } - - /// - /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. - /// - internal static System.IO.UnmanagedMemoryStream ding { - get { - return ResourceManager.GetStream("ding", resourceCulture); - } - } - } -} diff --git a/VsDingExtensionFor2012/Resources.resx b/VsDingExtensionFor2012/Resources.resx deleted file mode 100644 index 4a8cf71..0000000 --- a/VsDingExtensionFor2012/Resources.resx +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - Resources\build.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Resources\debug.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Resources\ding.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/VsDingExtensionFor2012/Resources/Package.ico b/VsDingExtensionFor2012/Resources/Package.ico deleted file mode 100644 index 449296f..0000000 Binary files a/VsDingExtensionFor2012/Resources/Package.ico and /dev/null differ diff --git a/VsDingExtensionFor2012/Resources/build.wav b/VsDingExtensionFor2012/Resources/build.wav deleted file mode 100644 index f837519..0000000 Binary files a/VsDingExtensionFor2012/Resources/build.wav and /dev/null differ diff --git a/VsDingExtensionFor2012/Resources/debug.wav b/VsDingExtensionFor2012/Resources/debug.wav deleted file mode 100644 index ed6ed85..0000000 Binary files a/VsDingExtensionFor2012/Resources/debug.wav and /dev/null differ diff --git a/VsDingExtensionFor2012/Resources/ding.wav b/VsDingExtensionFor2012/Resources/ding.wav deleted file mode 100644 index 44ee7bd..0000000 Binary files a/VsDingExtensionFor2012/Resources/ding.wav and /dev/null differ diff --git a/VsDingExtensionFor2012/Resources/speaker.ico b/VsDingExtensionFor2012/Resources/speaker.ico deleted file mode 100644 index f7a3433..0000000 Binary files a/VsDingExtensionFor2012/Resources/speaker.ico and /dev/null differ diff --git a/VsDingExtensionFor2012/VSPackage.resx b/VsDingExtensionFor2012/VSPackage.resx deleted file mode 100644 index 80ade04..0000000 --- a/VsDingExtensionFor2012/VSPackage.resx +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - VsDingExtensionProject - - - Information about my package - - - Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/VsDingExtensionFor2012/VsDingExtensionFor2012.csproj b/VsDingExtensionFor2012/VsDingExtensionFor2012.csproj index 0346eb5..e002f1f 100644 --- a/VsDingExtensionFor2012/VsDingExtensionFor2012.csproj +++ b/VsDingExtensionFor2012/VsDingExtensionFor2012.csproj @@ -5,6 +5,9 @@ 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + ..\VsDingExtensionProject\Resources\speaker.ico + Debug @@ -14,11 +17,10 @@ {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library Properties - Bing.VsDingExtensionFor2012 - VsDingExtensionFor2012 + VitaliiGanzha.VsDingExtension + VsDingExtension True - - + ..\VsDingExtensionProject\Key.snk v4.5 @@ -124,27 +126,28 @@ - - - - - + + + + + + Designer - - + + - - - - - + + + + + Always true diff --git a/VsDingExtensionFor2012/VsDingExtensionProjectPackage.cs b/VsDingExtensionFor2012/VsDingExtensionProjectPackage.cs deleted file mode 100644 index e55f103..0000000 --- a/VsDingExtensionFor2012/VsDingExtensionProjectPackage.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Diagnostics; -using System.Globalization; -using System.Media; -using System.Runtime.InteropServices; -using EnvDTE; -using EnvDTE80; -using Microsoft.VisualStudio.ComponentModelHost; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.TestWindow.Extensibility; - -namespace VitaliiGanzha.VsDingExtension -{ - [PackageRegistration(UseManagedResourcesOnly = true)] - [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] - [Guid(GuidList.guidVsDingExtensionProjectPkgString)] - [ProvideAutoLoad("{f1536ef8-92ec-443c-9ed7-fdadf150da82}")] - public sealed class VsDingExtensionProjectPackage : Package - { - private DTE2 applicationObject; - private AddIn addInInstance; - private BuildEvents buildEvents; - private DebuggerEvents debugEvents; - private SoundPlayer buildCompleteSoundPlayer; - private SoundPlayer debugSoundPlayer; - private SoundPlayer testCompleteSoundPlayer; - - public VsDingExtensionProjectPackage() - { - Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); - } - - #region Package Members - - protected override void Initialize() - { - Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", - this.ToString())); - base.Initialize(); - - buildCompleteSoundPlayer = new SoundPlayer(Resources.build); - debugSoundPlayer = new SoundPlayer(Resources.debug); - testCompleteSoundPlayer = new SoundPlayer(Resources.ding); - - applicationObject = (DTE2) GetService(typeof (DTE)); - - this.buildEvents = applicationObject.Events.BuildEvents; - this.debugEvents = applicationObject.Events.DebuggerEvents; - - buildEvents.OnBuildDone += (scope, action) => PlaySafe(buildCompleteSoundPlayer); - debugEvents.OnEnterBreakMode += delegate(dbgEventReason reason, ref dbgExecutionAction action) - { - if (reason != dbgEventReason.dbgEventReasonStep) - { - PlaySafe(debugSoundPlayer); - } - }; - - var componentModel = - Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof (SComponentModel)) as IComponentModel; - - if (componentModel == null) - { - Debug.WriteLine("componentModel is null"); - return; - } - - var operationState = componentModel.GetService(); - operationState.StateChanged += OperationStateOnStateChanged; - } - - private void PlaySafe(SoundPlayer soundPlayer) - { - try - { - soundPlayer.Play(); - } - catch (Exception ex) - { - ActivityLog.LogError(this.GetType().FullName, ex.Message); - } - } - - private void OperationStateOnStateChanged(object sender, OperationStateChangedEventArgs operationStateChangedEventArgs) - { - - if (operationStateChangedEventArgs.State.HasFlag(TestOperationStates.TestExecutionFinished)) - { - PlaySafe(testCompleteSoundPlayer); - } - } - #endregion - - } -} diff --git a/VsDingExtensionProject/VsDingExtensionProjectPackage.cs b/VsDingExtensionProject/VsDingExtensionProjectPackage.cs index 510fd5d..e249c8e 100644 --- a/VsDingExtensionProject/VsDingExtensionProjectPackage.cs +++ b/VsDingExtensionProject/VsDingExtensionProjectPackage.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.Globalization; using System.Media; using System.Runtime.InteropServices; @@ -41,16 +42,22 @@ namespace VitaliiGanzha.VsDingExtension debugSoundPlayer = new SoundPlayer(Resources.debug); testCompleteSoundPlayer = new SoundPlayer(Resources.ding); - applicationObject = (DTE2) GetService(typeof (DTE)); + applicationObject = (DTE2)GetService(typeof(DTE)); this.buildEvents = applicationObject.Events.BuildEvents; this.debugEvents = applicationObject.Events.DebuggerEvents; - buildEvents.OnBuildDone += (scope, action) => buildCompleteSoundPlayer.Play(); - debugEvents.OnEnterBreakMode += (dbgEventReason reason, ref dbgExecutionAction action) => debugSoundPlayer.Play(); + buildEvents.OnBuildDone += (scope, action) => PlaySafe(buildCompleteSoundPlayer); + debugEvents.OnEnterBreakMode += delegate(dbgEventReason reason, ref dbgExecutionAction action) + { + if (reason != dbgEventReason.dbgEventReasonStep) + { + PlaySafe(debugSoundPlayer); + } + }; var componentModel = - Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof (SComponentModel)) as IComponentModel; + Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SComponentModel)) as IComponentModel; if (componentModel == null) { @@ -62,12 +69,24 @@ namespace VitaliiGanzha.VsDingExtension operationState.StateChanged += OperationStateOnStateChanged; } + private void PlaySafe(SoundPlayer soundPlayer) + { + try + { + soundPlayer.Play(); + } + catch (Exception ex) + { + ActivityLog.LogError(this.GetType().FullName, ex.Message); + } + } + private void OperationStateOnStateChanged(object sender, OperationStateChangedEventArgs operationStateChangedEventArgs) { - + if (operationStateChangedEventArgs.State.HasFlag(TestOperationStates.TestExecutionFinished)) { - testCompleteSoundPlayer.Play(); + PlaySafe(testCompleteSoundPlayer); } } #endregion diff --git a/VsDingExtensionProject/source.extension.vsixmanifest b/VsDingExtensionProject/source.extension.vsixmanifest index 8c938db..bb228de 100644 --- a/VsDingExtensionProject/source.extension.vsixmanifest +++ b/VsDingExtensionProject/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Visual Studio Ding extension This small extension will play notification sounds when following events occur: - Build Complete