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 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}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5BD9D4DB-8683-4698-8D24-01EE7306F73A}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
IntegrationTests.testsettings = IntegrationTests.testsettings IntegrationTests.testsettings = IntegrationTests.testsettings

View File

@ -1,4 +1,4 @@
using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -18,7 +18,7 @@ namespace VitaliiGanzha.VsDingExtension
eventTypeToSoundPlayerMapping[EventType.BuildCompleted] = new List<SoundPlayer>() { new SoundPlayer(Resources.build) }; eventTypeToSoundPlayerMapping[EventType.BuildCompleted] = new List<SoundPlayer>() { new SoundPlayer(Resources.build) };
eventTypeToSoundPlayerMapping[EventType.BreakpointHit] = new List<SoundPlayer>() { new SoundPlayer(Resources.debug) }; eventTypeToSoundPlayerMapping[EventType.BreakpointHit] = new List<SoundPlayer>() { new SoundPlayer(Resources.debug) };
eventTypeToSoundPlayerMapping[EventType.TestsCompletedSuccess] = new List<SoundPlayer>() { new SoundPlayer(Resources.ding) }; 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) public void PlaySoundSafe(EventType eventType)
@ -66,6 +66,7 @@ namespace VitaliiGanzha.VsDingExtension
public enum EventType public enum EventType
{ {
None,
BuildCompleted, BuildCompleted,
BreakpointHit, BreakpointHit,
TestsCompletedSuccess, TestsCompletedSuccess,

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 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 // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@ -86,5 +86,14 @@ namespace VitaliiGanzha.VsDingExtension {
return ResourceManager.GetStream("ding", resourceCulture); 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> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
@ -127,4 +127,7 @@
<data name="ding" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <value>Resources\ding.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </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 partial class SoundSelectControl
{ {
@ -28,111 +28,73 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.TestsCompletedFailureControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
this.panel1 = new System.Windows.Forms.Panel(); this.TestCompletedSuccessControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
this.panel2 = new System.Windows.Forms.Panel(); this.breakPointHitControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
this.textBox1 = new System.Windows.Forms.TextBox(); this.buildCompletedControl = new VitaliiGanzha.VsDingExtension.SingleSoundSelectControl();
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.SuspendLayout(); this.SuspendLayout();
// //
// groupBox1 // TestsCompletedFailureControl
// //
this.groupBox1.AutoSize = true; this.TestsCompletedFailureControl.BoxTitle = "Tests completed, failure";
this.groupBox1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.TestsCompletedFailureControl.Dock = System.Windows.Forms.DockStyle.Top;
this.groupBox1.Controls.Add(this.panel1); this.TestsCompletedFailureControl.EventType = VitaliiGanzha.VsDingExtension.EventType.TestsCompletedFailure;
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.TestsCompletedFailureControl.Location = new System.Drawing.Point(0, 234);
this.groupBox1.Location = new System.Drawing.Point(0, 0); this.TestsCompletedFailureControl.Name = "TestsCompletedFailureControl";
this.groupBox1.Name = "groupBox1"; this.TestsCompletedFailureControl.Size = new System.Drawing.Size(452, 78);
this.groupBox1.Size = new System.Drawing.Size(452, 371); this.TestsCompletedFailureControl.TabIndex = 3;
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Select custom sounds";
// //
// panel1 // TestCompletedSuccessControl
// //
this.panel1.Controls.Add(this.panel2); this.TestCompletedSuccessControl.BoxTitle = "Tests completed, success";
this.panel1.Controls.Add(this.label1); this.TestCompletedSuccessControl.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.TestCompletedSuccessControl.EventType = VitaliiGanzha.VsDingExtension.EventType.TestsCompletedSuccess;
this.panel1.Location = new System.Drawing.Point(3, 16); this.TestCompletedSuccessControl.Location = new System.Drawing.Point(0, 156);
this.panel1.Name = "panel1"; this.TestCompletedSuccessControl.Name = "TestCompletedSuccessControl";
this.panel1.Size = new System.Drawing.Size(446, 53); this.TestCompletedSuccessControl.Size = new System.Drawing.Size(452, 78);
this.panel1.TabIndex = 0; this.TestCompletedSuccessControl.TabIndex = 2;
// //
// panel2 // breakPointHitControl
// //
this.panel2.Controls.Add(this.textBox1); this.breakPointHitControl.BoxTitle = "Breakpoint hit";
this.panel2.Controls.Add(this.button1); this.breakPointHitControl.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; this.breakPointHitControl.EventType = VitaliiGanzha.VsDingExtension.EventType.BreakpointHit;
this.panel2.Location = new System.Drawing.Point(0, 18); this.breakPointHitControl.Location = new System.Drawing.Point(0, 78);
this.panel2.Name = "panel2"; this.breakPointHitControl.Name = "breakPointHitControl";
this.panel2.Size = new System.Drawing.Size(446, 35); this.breakPointHitControl.Size = new System.Drawing.Size(452, 78);
this.panel2.TabIndex = 1; this.breakPointHitControl.TabIndex = 1;
// //
// textBox1 // buildCompletedControl
// //
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.buildCompletedControl.BoxTitle = "Build completed";
| System.Windows.Forms.AnchorStyles.Right))); this.buildCompletedControl.Dock = System.Windows.Forms.DockStyle.Top;
this.textBox1.Location = new System.Drawing.Point(0, 0); this.buildCompletedControl.EventType = VitaliiGanzha.VsDingExtension.EventType.BuildCompleted;
this.textBox1.Name = "textBox1"; this.buildCompletedControl.Location = new System.Drawing.Point(0, 0);
this.textBox1.Size = new System.Drawing.Size(349, 20); this.buildCompletedControl.Name = "buildCompletedControl";
this.textBox1.TabIndex = 1; this.buildCompletedControl.Size = new System.Drawing.Size(452, 78);
// this.buildCompletedControl.TabIndex = 0;
// 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;
// //
// SoundSelectControl // SoundSelectControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 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.Name = "SoundSelectControl";
this.Size = new System.Drawing.Size(452, 371); 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.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.GroupBox groupBox1; private SingleSoundSelectControl buildCompletedControl;
private System.Windows.Forms.Panel panel1; private SingleSoundSelectControl TestCompletedSuccessControl;
private System.Windows.Forms.Label label1; private SingleSoundSelectControl breakPointHitControl;
private System.Windows.Forms.Panel panel2; private SingleSoundSelectControl TestsCompletedFailureControl;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox1;
private SoundsSelectOptionsPage soundsSelectOptionsPage1;
} }
} }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
@ -12,7 +12,25 @@ namespace VitaliiGanzha.VsDingExtension
{ {
public partial class SoundSelectControl : UserControl 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() public SoundSelectControl()
{ {

View File

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

View File

@ -1,4 +1,4 @@
using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell;
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Drawing; using System.Drawing;
@ -36,20 +36,39 @@ namespace VitaliiGanzha.VsDingExtension
{ {
if (optionsControl == null) if (optionsControl == null)
{ {
optionsControl = new SoundSelectControl(); optionsControl = new SoundSelectControl
optionsControl.Location = new Point(0, 0); {
optionsControl.optionsPage = this; Location = new Point(0, 0),
OptionsPage = this
};
} }
return optionsControl; 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)] [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 #endregion Properties

View File

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