Removed duplicated files, built version for 2013 and 2012
This commit is contained in:
		
							parent
							
								
									74b86d7e6b
								
							
						
					
					
						commit
						845b9c58d4
					
				
					 14 changed files with 46 additions and 505 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
<?xml version="1.0" encoding="utf-8"?>
 | 
			
		||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
 | 
			
		||||
  <Metadata>
 | 
			
		||||
    <Identity Id="26ba08d0-0d25-4479-8684-3054dd122876" Version="1.0" Language="en-US" Publisher="Vitalii Ganzha" />
 | 
			
		||||
    <Identity Id="26ba08d0-0d25-4479-8684-3054dd122876" Version="1.1" Language="en-US" Publisher="Vitalii Ganzha" />
 | 
			
		||||
    <DisplayName>Visual Studio Ding extension</DisplayName>
 | 
			
		||||
    <Description xml:space="preserve">This small extension will play notification sounds when following events occur:
 | 
			
		||||
- Build Complete
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue