Issue #7: Use different sound when tests failed

Issue #5: Custom sounds
This commit is contained in:
Vitalii Ganzha 2016-01-05 17:25:06 -08:00
parent 9de93268f2
commit df15518a52
13 changed files with 488 additions and 106 deletions

View File

@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 12
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5BD9D4DB-8683-4698-8D24-01EE7306F73A}"
ProjectSection(SolutionItems) = preProject
IntegrationTests.testsettings = IntegrationTests.testsettings

View File

@ -1,4 +1,4 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell;
using System;
using System.Collections.Generic;
using System.Linq;
@ -18,7 +18,7 @@ namespace VitaliiGanzha.VsDingExtension
eventTypeToSoundPlayerMapping[EventType.BuildCompleted] = new List<SoundPlayer>() { new SoundPlayer(Resources.build) };
eventTypeToSoundPlayerMapping[EventType.BreakpointHit] = new List<SoundPlayer>() { new SoundPlayer(Resources.debug) };
eventTypeToSoundPlayerMapping[EventType.TestsCompletedSuccess] = new List<SoundPlayer>() { new SoundPlayer(Resources.ding) };
eventTypeToSoundPlayerMapping[EventType.TestsCompletedFailure] = new List<SoundPlayer>() { new SoundPlayer(Resources.ding) }; // TODO: different sound for failed tests
eventTypeToSoundPlayerMapping[EventType.TestsCompletedFailure] = new List<SoundPlayer>() { new SoundPlayer(Resources.test_failed) };
}
public void PlaySoundSafe(EventType eventType)
@ -66,6 +66,7 @@ namespace VitaliiGanzha.VsDingExtension
public enum EventType
{
None,
BuildCompleted,
BreakpointHit,
TestsCompletedSuccess,

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -86,5 +86,14 @@ namespace VitaliiGanzha.VsDingExtension {
return ResourceManager.GetStream("ding", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream test_failed {
get {
return ResourceManager.GetStream("test_failed", resourceCulture);
}
}
}
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@ -127,4 +127,7 @@
<data name="ding" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\ding.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
<data name="test_failed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Resources\test-failed.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.

View File

@ -0,0 +1,110 @@
namespace VitaliiGanzha.VsDingExtension
{
partial class SingleSoundSelectControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox = new System.Windows.Forms.GroupBox();
this.btnBrowse = new System.Windows.Forms.Button();
this.selectedFileEdit = new System.Windows.Forms.TextBox();
this.chkUseDifferentSound = new System.Windows.Forms.CheckBox();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.groupBox.SuspendLayout();
this.SuspendLayout();
//
// groupBox
//
this.groupBox.Controls.Add(this.btnBrowse);
this.groupBox.Controls.Add(this.selectedFileEdit);
this.groupBox.Controls.Add(this.chkUseDifferentSound);
this.groupBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox.Location = new System.Drawing.Point(0, 0);
this.groupBox.Name = "groupBox";
this.groupBox.Size = new System.Drawing.Size(323, 78);
this.groupBox.TabIndex = 0;
this.groupBox.TabStop = false;
this.groupBox.Text = "Title";
//
// btnBrowse
//
this.btnBrowse.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.btnBrowse.Location = new System.Drawing.Point(242, 40);
this.btnBrowse.Name = "btnBrowse";
this.btnBrowse.Size = new System.Drawing.Size(75, 23);
this.btnBrowse.TabIndex = 2;
this.btnBrowse.Text = "Browse...";
this.btnBrowse.UseVisualStyleBackColor = true;
this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
//
// selectedFileEdit
//
this.selectedFileEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.selectedFileEdit.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.selectedFileEdit.Location = new System.Drawing.Point(6, 40);
this.selectedFileEdit.Name = "selectedFileEdit";
this.selectedFileEdit.Size = new System.Drawing.Size(230, 22);
this.selectedFileEdit.TabIndex = 1;
//
// chkUseDifferentSound
//
this.chkUseDifferentSound.AutoSize = true;
this.chkUseDifferentSound.Location = new System.Drawing.Point(6, 19);
this.chkUseDifferentSound.Name = "chkUseDifferentSound";
this.chkUseDifferentSound.Size = new System.Drawing.Size(118, 17);
this.chkUseDifferentSound.TabIndex = 0;
this.chkUseDifferentSound.Text = "Use different sound";
this.chkUseDifferentSound.UseVisualStyleBackColor = true;
this.chkUseDifferentSound.CheckedChanged += new System.EventHandler(this.chkUseDifferentSound_CheckedChanged);
//
// openFileDialog
//
this.openFileDialog.Filter = "Wav files|*.wav";
this.openFileDialog.Title = "Select custom sound";
//
// SingleSoundSelectControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox);
this.Name = "SingleSoundSelectControl";
this.Size = new System.Drawing.Size(323, 78);
this.groupBox.ResumeLayout(false);
this.groupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox;
private System.Windows.Forms.CheckBox chkUseDifferentSound;
private System.Windows.Forms.Button btnBrowse;
private System.Windows.Forms.TextBox selectedFileEdit;
private System.Windows.Forms.OpenFileDialog openFileDialog;
}
}

View File

@ -0,0 +1,128 @@
namespace VitaliiGanzha.VsDingExtension
{
using System;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
public partial class SingleSoundSelectControl : UserControl
{
private EventType eventType = EventType.None;
public SoundsSelectOptionsPage OptionsPage = null;
[Category("Data")]
[Description("Gets or sets the event type of the sound to override sound for")]
public EventType EventType
{
get { return this.eventType; }
set { this.eventType = value; }
}
[Category("Data")]
[Description("Gets or sets the title of the group box")]
public string BoxTitle
{
get { return this.groupBox.Text; }
set { this.groupBox.Text = value; }
}
public SingleSoundSelectControl()
{
InitializeComponent();
ReadOptions();
}
private void chkUseDifferentSound_CheckedChanged(object sender, System.EventArgs e)
{
ValidateProperties();
this.StoreOptions();
}
private void btnBrowse_Click(object sender, EventArgs e)
{
this.ValidateProperties();
var dialogResult = this.openFileDialog.ShowDialog();
if (dialogResult != DialogResult.OK)
{
return;
}
var file = openFileDialog.FileName;
if (File.Exists(file))
{
this.selectedFileEdit.Text = file;
this.StoreOptions();
}
}
private void ValidateProperties()
{
if (this.EventType == EventType.None)
{
throw new Exception("Event type not initialized");
}
if (this.OptionsPage == null)
{
throw new Exception("Options Page not initialized");
}
}
private void StoreOptions()
{
var useDifferentSound = this.chkUseDifferentSound.Checked;
var pathToFile = this.selectedFileEdit.Text;
switch (eventType)
{
case EventType.BreakpointHit:
this.OptionsPage.OverrideOnBreakpointHitSound = useDifferentSound;
this.OptionsPage.CustomOnBreakpointHitSoundLocation = pathToFile;
break;
case EventType.BuildCompleted:
this.OptionsPage.OverrideOnBuildSound = useDifferentSound;
this.OptionsPage.CustomOnBuildSoundLocation = pathToFile;
break;
case EventType.TestsCompletedFailure:
this.OptionsPage.OverrideOnTestCompleteFailureSound = useDifferentSound;
this.OptionsPage.CustomOnTestCompleteFailureSoundLocation = pathToFile;
break;
case EventType.TestsCompletedSuccess:
this.OptionsPage.OverrideOnTestCompleteSuccesSound = useDifferentSound;
this.OptionsPage.CustomOnTestCompleteSuccesSoundLocation = pathToFile;
break;
default:
throw new Exception("Invalid Event Type");
}
}
public void ReadOptions()
{
string pathToFile = null;
bool useDifferentSound = false;
switch (eventType)
{
case EventType.BreakpointHit:
useDifferentSound = this.OptionsPage.OverrideOnBreakpointHitSound;
pathToFile = this.OptionsPage.CustomOnBreakpointHitSoundLocation;
break;
case EventType.BuildCompleted:
useDifferentSound = this.OptionsPage.OverrideOnBuildSound;
pathToFile = this.OptionsPage.CustomOnBuildSoundLocation;
break;
case EventType.TestsCompletedFailure:
useDifferentSound = this.OptionsPage.OverrideOnTestCompleteFailureSound;
pathToFile = this.OptionsPage.CustomOnTestCompleteFailureSoundLocation;
break;
case EventType.TestsCompletedSuccess:
useDifferentSound = this.OptionsPage.OverrideOnTestCompleteSuccesSound;
pathToFile = this.OptionsPage.CustomOnTestCompleteSuccesSoundLocation;
break;
}
this.selectedFileEdit.Text = pathToFile;
this.chkUseDifferentSound.Checked = useDifferentSound;
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -1,4 +1,4 @@
namespace VitaliiGanzha.VsDingExtension
namespace VitaliiGanzha.VsDingExtension
{
partial class SoundSelectControl
{
@ -28,111 +28,73 @@
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.panel1 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.soundsSelectOptionsPage1 = new VitaliiGanzha.VsDingExtension.SoundsSelectOptionsPage();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.TestsCompletedFailureControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
this.TestCompletedSuccessControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
this.breakPointHitControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
this.buildCompletedControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
this.SuspendLayout();
//
// groupBox1
// TestsCompletedFailureControl
//
this.groupBox1.AutoSize = true;
this.groupBox1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.groupBox1.Controls.Add(this.panel1);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(0, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(452, 371);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Select custom sounds";
this.TestsCompletedFailureControl.BoxTitle = "Tests completed, failure";
this.TestsCompletedFailureControl.Dock = System.Windows.Forms.DockStyle.Top;
this.TestsCompletedFailureControl.EventType = VitaliiGanzha.VsDingExtension.EventType.TestsCompletedFailure;
this.TestsCompletedFailureControl.Location = new System.Drawing.Point(0, 234);
this.TestsCompletedFailureControl.Name = "TestsCompletedFailureControl";
this.TestsCompletedFailureControl.Size = new System.Drawing.Size(452, 78);
this.TestsCompletedFailureControl.TabIndex = 3;
//
// panel1
// TestCompletedSuccessControl
//
this.panel1.Controls.Add(this.panel2);
this.panel1.Controls.Add(this.label1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(3, 16);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(446, 53);
this.panel1.TabIndex = 0;
this.TestCompletedSuccessControl.BoxTitle = "Tests completed, success";
this.TestCompletedSuccessControl.Dock = System.Windows.Forms.DockStyle.Top;
this.TestCompletedSuccessControl.EventType = VitaliiGanzha.VsDingExtension.EventType.TestsCompletedSuccess;
this.TestCompletedSuccessControl.Location = new System.Drawing.Point(0, 156);
this.TestCompletedSuccessControl.Name = "TestCompletedSuccessControl";
this.TestCompletedSuccessControl.Size = new System.Drawing.Size(452, 78);
this.TestCompletedSuccessControl.TabIndex = 2;
//
// panel2
// breakPointHitControl
//
this.panel2.Controls.Add(this.textBox1);
this.panel2.Controls.Add(this.button1);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(0, 18);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(446, 35);
this.panel2.TabIndex = 1;
this.breakPointHitControl.BoxTitle = "Breakpoint hit";
this.breakPointHitControl.Dock = System.Windows.Forms.DockStyle.Top;
this.breakPointHitControl.EventType = VitaliiGanzha.VsDingExtension.EventType.BreakpointHit;
this.breakPointHitControl.Location = new System.Drawing.Point(0, 78);
this.breakPointHitControl.Name = "breakPointHitControl";
this.breakPointHitControl.Size = new System.Drawing.Size(452, 78);
this.breakPointHitControl.TabIndex = 1;
//
// textBox1
// buildCompletedControl
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(0, 0);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(349, 20);
this.textBox1.TabIndex = 1;
//
// button1
//
this.button1.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.button1.Location = new System.Drawing.Point(415, 0);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(31, 32);
this.button1.TabIndex = 0;
this.button1.Text = "...";
this.button1.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 5);
this.label1.Size = new System.Drawing.Size(85, 18);
this.label1.TabIndex = 0;
this.label1.Text = "Build completed:";
//
// soundsSelectOptionsPage1
//
this.soundsSelectOptionsPage1.CustomBitmap = null;
this.buildCompletedControl.BoxTitle = "Build completed";
this.buildCompletedControl.Dock = System.Windows.Forms.DockStyle.Top;
this.buildCompletedControl.EventType = VitaliiGanzha.VsDingExtension.EventType.BuildCompleted;
this.buildCompletedControl.Location = new System.Drawing.Point(0, 0);
this.buildCompletedControl.Name = "buildCompletedControl";
this.buildCompletedControl.Size = new System.Drawing.Size(452, 78);
this.buildCompletedControl.TabIndex = 0;
//
// SoundSelectControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.groupBox1);
this.AutoScroll = true;
this.Controls.Add(this.TestsCompletedFailureControl);
this.Controls.Add(this.TestCompletedSuccessControl);
this.Controls.Add(this.breakPointHitControl);
this.Controls.Add(this.buildCompletedControl);
this.Name = "SoundSelectControl";
this.Size = new System.Drawing.Size(452, 371);
this.groupBox1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private SoundsSelectOptionsPage soundsSelectOptionsPage1;
private SingleSoundSelectControl buildCompletedControl;
private SingleSoundSelectControl TestCompletedSuccessControl;
private SingleSoundSelectControl breakPointHitControl;
private SingleSoundSelectControl TestsCompletedFailureControl;
}
}

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
@ -12,7 +12,25 @@ namespace VitaliiGanzha.VsDingExtension
{
public partial class SoundSelectControl : UserControl
{
internal SoundsSelectOptionsPage optionsPage;
private SoundsSelectOptionsPage optionsPage;
internal SoundsSelectOptionsPage OptionsPage
{
get { return this.optionsPage; }
set
{
this.optionsPage = value;
UpdateOptionPage();
}
}
private void UpdateOptionPage()
{
this.TestCompletedSuccessControl.OptionsPage = this.optionsPage;
this.TestsCompletedFailureControl.OptionsPage = this.optionsPage;
this.buildCompletedControl.OptionsPage = this.optionsPage;
this.breakPointHitControl.OptionsPage = this.optionsPage;
}
public SoundSelectControl()
{

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
@ -117,7 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="soundsSelectOptionsPage1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
</root>

View File

@ -1,4 +1,4 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell;
using System;
using System.ComponentModel;
using System.Drawing;
@ -36,20 +36,39 @@ namespace VitaliiGanzha.VsDingExtension
{
if (optionsControl == null)
{
optionsControl = new SoundSelectControl();
optionsControl.Location = new Point(0, 0);
optionsControl.optionsPage = this;
optionsControl = new SoundSelectControl
{
Location = new Point(0, 0),
OptionsPage = this
};
}
return optionsControl;
}
}
/// <summary>
/// Gets or sets the path to the image file.
/// </summary>
/// <remarks>The property that needs to be persisted.</remarks>
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string CustomBitmap { get; set; }
public bool OverrideOnBuildSound { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string CustomOnBuildSoundLocation { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool OverrideOnTestCompleteSuccesSound { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string CustomOnTestCompleteSuccesSoundLocation { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool OverrideOnTestCompleteFailureSound { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string CustomOnTestCompleteFailureSoundLocation { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public bool OverrideOnBreakpointHitSound { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public string CustomOnBreakpointHitSoundLocation { get; set; }
#endregion Properties

View File

@ -169,6 +169,12 @@
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="SingleSoundSelectControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="SingleSoundSelectControl.Designer.cs">
<DependentUpon>SingleSoundSelectControl.cs</DependentUpon>
</Compile>
<Compile Include="SoundSelectControl.cs">
<SubType>UserControl</SubType>
</Compile>
@ -188,6 +194,9 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="SingleSoundSelectControl.resx">
<DependentUpon>SingleSoundSelectControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SoundSelectControl.resx">
<DependentUpon>SoundSelectControl.cs</DependentUpon>
</EmbeddedResource>
@ -213,6 +222,7 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="Resources\test-failed.wav" />
<Content Include="speaker.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>