Skip to content

Commit f98c780

Browse files
committed
Added Preferences page back into VSIX, attribute on package. Updated expression editor, and added preferences for font and colours, on expression editor as requested.
1 parent f5b334b commit f98c780

13 files changed

Lines changed: 387 additions & 103 deletions

BidsHelperPackage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public enum enumIDEMode
5151
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
5252
[ProvideMenuResource("Menus.ctmenu", 1)]
5353
[ProvideOptionPage(typeof(BIDSHelperOptionsFeatures), "BIDS Helper", "Features", 0, 0, true)]
54-
//[ProvideOptionPage(typeof(BIDSHelperOptionsPreferences), "BIDS Helper", "Preferences", 0, 0, true)]
54+
[ProvideOptionPage(typeof(BIDSHelperPreferencesDialogPage), "BIDS Helper", "Preferences", 0, 0, true)]
5555
[ProvideOptionPage(typeof(BIDSHelperOptionsVersion), "BIDS Helper", "Version", 0, 0, true)]
5656
public sealed class BIDSHelperPackage : Package, IVsDebuggerEvents
5757
{

Core/Options/BIDSHelperOptionsPage.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ public partial class BIDSHelperOptionsPage : UserControl //, EnvDTE.IDTToolsOpti
1616
/// </summary>
1717
private static string DefaultMessageBoxCaption = "BIDS Helper Options";
1818

19-
20-
21-
2219
/// <summary>
2320
/// Initializes a new instance of the <see cref="BIDSHelperOptionsPage"/> class.
2421
/// </summary>
@@ -27,12 +24,9 @@ public BIDSHelperOptionsPage()
2724
InitializeComponent();
2825
}
2926

30-
31-
3227
/// <summary>
3328
/// Called after the dialog has been created.
3429
/// </summary>
35-
/// <param name="DTEObject">The DTE object.</param>
3630
public void Initialize()
3731
{
3832
// Enumerate plug-ins and create a dynamic properties

Core/Options/BIDSHelperOptionsPreferences.cs renamed to Core/Options/BIDSHelperPreferencesDialogPage.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ namespace BIDSHelper.Core
1313
{
1414
[ClassInterface(ClassInterfaceType.AutoDual)]
1515
[CLSCompliant(false), ComVisible(true)]
16-
//[Guid(BIDSHelperOptionsVersion.OptionsGuidString)]
17-
public class BIDSHelperOptionsPreferences : DialogPage
16+
[Guid("5F8DEE5F-2790-4EE2-B709-A3F2D11E2042")]
17+
public class BIDSHelperPreferencesDialogPage : DialogPage
1818
{
19-
// public const string OptionsGuidString = "9EBCE16B-26C2-4A22-A409-9752750A16AE";
20-
BIDSHelperPreferencesPage page = null;
19+
private BIDSHelperPreferencesPage page = null;
2120

2221
protected override IWin32Window Window
2322
{
2423
get
2524
{
2625
page = new BIDSHelperPreferencesPage();
27-
//page.optionsPage = this;
26+
page.OptionsPage = this;
2827
page.Initialize();
2928
return page;
3029
}

Core/Options/BIDSHelperPreferencesPage.Designer.cs

Lines changed: 181 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
11
namespace BIDSHelper.Core
22
{
3+
using BIDSHelper.SSIS;
34
using System;
4-
using System.Collections.Generic;
5-
using System.ComponentModel;
6-
using System.Drawing;
7-
using System.Data;
8-
using System.Text;
95
using System.Windows.Forms;
10-
using EnvDTE;
11-
using BIDSHelper.SSIS;
12-
6+
137
public partial class BIDSHelperPreferencesPage : UserControl
148
{
159
public BIDSHelperPreferencesPage()
1610
{
1711
InitializeComponent();
1812
}
1913

20-
#region IDTToolsOptionsPage Members
14+
public BIDSHelperPreferencesDialogPage OptionsPage
15+
{
16+
get;
17+
set;
18+
}
2119

2220
public void Initialize()
2321
{
2422
this.Width = 395; //392
2523
this.Height = 290;
2624

25+
// Smart Diff
2726
lblTFS.Text = "Visual Studio Built-in";
2827
lblVSS.Text = string.Empty;
2928

30-
3129
if (string.IsNullOrEmpty(SmartDiffPlugin.CustomDiffViewer))
3230
{
3331
radSmartDiffDefault.Checked = true;
@@ -38,19 +36,28 @@ public void Initialize()
3836
radSmartDiffCustom.Checked = true;
3937
txtSmartDiffCustom.Text = SmartDiffPlugin.CustomDiffViewer;
4038
}
39+
4140
FixSmartDiffCustomEnabled();
4241

42+
// Expression & Configuration highlighter
4343
btnExpressionColor.BackColor = ExpressionHighlighterPlugin.ExpressionColor;
4444
btnConfigurationColor.BackColor = ExpressionHighlighterPlugin.ConfigurationColor;
4545

46+
// Measure group free space
4647
txtFreeSpaceFactor.Text = MeasureGroupHealthCheckPlugin.FreeSpaceFactor.ToString();
47-
}
4848

49+
// Expression editor, font and colours
50+
buttonExpressionFontSample.Font = ExpressionListPlugin.ExpressionFont;
51+
buttonExpressionFontSample.ForeColor = ExpressionListPlugin.ExpressionColor;
52+
buttonResultFontSample.Font = ExpressionListPlugin.ResultFont;
53+
buttonResultFontSample.ForeColor = ExpressionListPlugin.ResultColor;
54+
}
4955

5056
public void Apply()
5157
{
5258
try
5359
{
60+
// Smart Diff
5461
if (radSmartDiffCustom.Checked)
5562
{
5663
SmartDiffPlugin.CustomDiffViewer = txtSmartDiffCustom.Text;
@@ -60,36 +67,29 @@ public void Apply()
6067
SmartDiffPlugin.CustomDiffViewer = null;
6168
}
6269

70+
// Expression & Configuration highlighter
6371
ExpressionHighlighterPlugin.ExpressionColor = btnExpressionColor.BackColor;
6472
ExpressionHighlighterPlugin.ConfigurationColor = btnConfigurationColor.BackColor;
6573

74+
// Measure group free space
6675
int iFreeSpaceFactor;
6776
if (int.TryParse(txtFreeSpaceFactor.Text, out iFreeSpaceFactor))
77+
{
6878
MeasureGroupHealthCheckPlugin.FreeSpaceFactor = iFreeSpaceFactor;
69-
//BIDSHelperPluginBase pu = null;
70-
////foreach (object itm in lstPlugins.Items) //(BIDSHelperPluginReference puRef in Connect.Plugins.Values)
71-
//for (int i = 0;i<lstPlugins.Items.Count;i++)
72-
//{
73-
// pu = (BIDSHelperPluginBase)lstPlugins.Items[i];
74-
// if (pu.Enabled != lstPlugins.GetItemChecked(i))
75-
// {
76-
// pu.Enabled = lstPlugins.GetItemChecked(i);
77-
// }
78-
//}
79+
}
80+
81+
// Expression editor, font and colours
82+
ExpressionListPlugin.ExpressionFont = buttonExpressionFontSample.Font;
83+
ExpressionListPlugin.ExpressionColor = buttonExpressionFontSample.ForeColor;
84+
ExpressionListPlugin.ResultFont = buttonResultFontSample.Font;
85+
ExpressionListPlugin.ResultColor = buttonResultFontSample.ForeColor;
7986
}
8087
catch (Exception ex)
8188
{
8289
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
8390
}
8491
}
8592

86-
#endregion
87-
88-
private void BIDSHelperPreferencesPage_Load(object sender, EventArgs e)
89-
{
90-
91-
}
92-
9393
private void radSmartDiffDefault_CheckedChanged(object sender, EventArgs e)
9494
{
9595
FixSmartDiffCustomEnabled();
@@ -107,19 +107,19 @@ private void radSmartDiffCustom_CheckedChanged(object sender, EventArgs e)
107107

108108
private void btnExpressionColor_Click(object sender, EventArgs e)
109109
{
110-
colorDialog1.Color = btnExpressionColor.BackColor;
111-
if (colorDialog1.ShowDialog() == DialogResult.OK)
110+
colorDialog.Color = btnExpressionColor.BackColor;
111+
if (colorDialog.ShowDialog() == DialogResult.OK)
112112
{
113-
btnExpressionColor.BackColor = colorDialog1.Color;
113+
btnExpressionColor.BackColor = colorDialog.Color;
114114
}
115115
}
116116

117117
private void btnConfigurationColor_Click(object sender, EventArgs e)
118118
{
119-
colorDialog1.Color = btnConfigurationColor.BackColor;
120-
if (colorDialog1.ShowDialog() == DialogResult.OK)
119+
colorDialog.Color = btnConfigurationColor.BackColor;
120+
if (colorDialog.ShowDialog() == DialogResult.OK)
121121
{
122-
btnConfigurationColor.BackColor = colorDialog1.Color;
122+
btnConfigurationColor.BackColor = colorDialog.Color;
123123
}
124124
}
125125

@@ -138,6 +138,29 @@ private void txtFreeSpaceFactor_Leave(object sender, EventArgs e)
138138
if (!int.TryParse(txtFreeSpaceFactor.Text, out i))
139139
txtFreeSpaceFactor.Text = MeasureGroupHealthCheckPlugin.FreeSpaceFactor.ToString();
140140
}
141+
142+
private void buttonExpressionFont_Click(object sender, EventArgs e)
143+
{
144+
fontDialog.Font = buttonExpressionFontSample.Font;
145+
fontDialog.Color = buttonExpressionFontSample.ForeColor;
146+
if (fontDialog.ShowDialog() == DialogResult.OK)
147+
{
148+
buttonExpressionFontSample.Font = fontDialog.Font;
149+
buttonExpressionFontSample.ForeColor = fontDialog.Color;
150+
}
151+
}
152+
153+
private void buttonResultFont_Click(object sender, EventArgs e)
154+
{
155+
fontDialog.Font = buttonResultFontSample.Font;
156+
fontDialog.Color = buttonResultFontSample.ForeColor;
157+
if (fontDialog.ShowDialog() == DialogResult.OK)
158+
{
159+
buttonResultFontSample.Font = fontDialog.Font;
160+
buttonResultFontSample.ForeColor = fontDialog.Color;
161+
}
162+
163+
}
141164
}
142165

143166
}

Core/Options/BIDSHelperPreferencesPage.resx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,15 @@
112112
<value>2.0</value>
113113
</resheader>
114114
<resheader name="reader">
115-
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
115+
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116116
</resheader>
117117
<resheader name="writer">
118-
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
118+
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
120+
<metadata name="colorDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121
<value>17, 17</value>
122122
</metadata>
123+
<metadata name="fontDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124+
<value>131, 17</value>
125+
</metadata>
123126
</root>

DLLs/SQL2012/ExpressionEditor.dll

512 Bytes
Binary file not shown.

DLLs/SQL2014/ExpressionEditor.dll

512 Bytes
Binary file not shown.

DLLs/SQL2016/ExpressionEditor.dll

512 Bytes
Binary file not shown.

SQL2012_BidsHelper-VSIX.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<Compile Include="Core\Logger\LogLevels.cs" />
8686
<Compile Include="Core\Logger\NullLogger.cs" />
8787
<Compile Include="Core\Logger\OutputLogger.cs" />
88-
<Compile Include="Core\Options\BIDSHelperOptionsPreferences.cs">
88+
<Compile Include="Core\Options\BIDSHelperPreferencesDialogPage.cs">
8989
<SubType>Component</SubType>
9090
</Compile>
9191
<Compile Include="Core\Options\BIDSHelperOptionsVersion.cs">

0 commit comments

Comments
 (0)