11namespace 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}
0 commit comments