9
9
//*******************************************************************//
10
10
11
11
using System ;
12
+ using System . Drawing ;
12
13
using System . Windows . Forms ;
13
14
using ActiveQueryBuilder . Core ;
14
15
using ActiveQueryBuilder . Core . PropertiesEditors ;
@@ -47,14 +48,15 @@ private void FillSyntaxTypes()
47
48
foreach ( Type syntax in Helpers . SyntaxProviderList )
48
49
{
49
50
var instance = Activator . CreateInstance ( syntax ) as BaseSyntaxProvider ;
51
+
52
+ if ( instance == null )
53
+ continue ;
54
+
50
55
cbSyntax . Items . Add ( instance . Description ) ;
51
56
}
52
57
}
53
58
54
- private void tbXmlPath_TextChanged ( object sender , EventArgs e )
55
- {
56
- _connection . XMLPath = tbXmlPath . Text ;
57
- }
59
+ private void tbXmlPath_TextChanged ( object sender , EventArgs e ) => _connection . XMLPath = tbXmlPath . Text ;
58
60
59
61
private void btnOpenDialog_Click ( object sender , EventArgs e )
60
62
{
@@ -66,6 +68,8 @@ private void btnOpenDialog_Click(object sender, EventArgs e)
66
68
67
69
private void cbSyntax_SelectedIndexChanged ( object sender , EventArgs e )
68
70
{
71
+ ClientSize = new Size ( ClientSize . Width , mainTable . Height + Padding . Top + Padding . Bottom ) ;
72
+
69
73
var syntaxType = GetSelectedSyntaxType ( ) ;
70
74
if ( _connection . ConnectionDescriptor . SyntaxProvider . GetType ( ) == syntaxType )
71
75
{
@@ -77,6 +81,13 @@ private void cbSyntax_SelectedIndexChanged(object sender, EventArgs e)
77
81
RecreateSyntaxFrame ( ) ;
78
82
}
79
83
84
+ protected override void OnLoad ( EventArgs e )
85
+ {
86
+ ClientSize = new Size ( ClientSize . Width , mainTable . Height + Padding . Top + Padding . Bottom ) ;
87
+
88
+ base . OnLoad ( e ) ;
89
+ }
90
+
80
91
private Type GetSelectedSyntaxType ( )
81
92
{
82
93
return Helpers . SyntaxProviderList [ cbSyntax . SelectedIndex ] ;
@@ -102,7 +113,6 @@ private void RecreateSyntaxFrame()
102
113
( pbSyntax as IPropertiesControl ) . SetProperties ( container ) ;
103
114
104
115
pbSyntax . Height = pbSyntax . Controls [ 0 ] . Bottom + 5 ;
105
- Height = pnlTop . Height + pbSyntax . Height + pnlFilePath . Height + 90 ;
106
116
}
107
117
108
118
private void ClearProperties ( ObjectProperties properties )
0 commit comments