10
10
using log4net . Core ;
11
11
using log4net . Repository . Hierarchy ;
12
12
using MossbauerLab . TinyTcpServer . Core . Client ;
13
+ using MossbauerLab . TinyTcpServer . Core . Scripting ;
13
14
using MossbauerLab . TinyTcpServer . Core . Server ;
14
15
using MossbauerLab . TinyTcpServer . MnGUI . Factories ;
15
16
using MossbauerLab . TinyTcpServer . MnGUI . Helpers ;
@@ -84,8 +85,10 @@ private void Start()
84
85
{
85
86
if ( ! String . IsNullOrEmpty ( _configFile ) )
86
87
_serverConfig = TcpServerConfigBuilder . Build ( _configFile ) ;
88
+ if ( ! String . IsNullOrEmpty ( _compilerOptionsFile ) )
89
+ _compilerOptions = CompilerOptionsBuilder . Build ( _compilerOptionsFile ) ;
87
90
if ( _ipAddressComboBox . SelectedIndex >= 0 && _portTextBox . Text != null && ! String . IsNullOrEmpty ( _scriptFile ) )
88
- _server = ServerFactory . Create ( _ipAddressComboBox . Items [ _ipAddressComboBox . SelectedIndex ] . ToString ( ) , port , _scriptFile , _logger , null , _serverConfig ) ;
91
+ _server = ServerFactory . Create ( _ipAddressComboBox . Items [ _ipAddressComboBox . SelectedIndex ] . ToString ( ) , port , _scriptFile , _logger , _compilerOptions , _serverConfig ) ;
89
92
else
90
93
{
91
94
MessageBox . Show ( @"Can not start server, please select IP address, port and server script" ) ;
@@ -95,8 +98,10 @@ private void Start()
95
98
}
96
99
else
97
100
{
98
- if ( _configChanged )
99
- _server = ServerFactory . Create ( _ipAddressComboBox . Items [ _ipAddressComboBox . SelectedIndex ] . ToString ( ) , port , _scriptFile , _logger , null , _serverConfig ) ;
101
+ if ( ! String . IsNullOrEmpty ( _compilerOptionsFile ) )
102
+ _compilerOptions = CompilerOptionsBuilder . Build ( _compilerOptionsFile ) ;
103
+ if ( _configChanged )
104
+ _server = ServerFactory . Create ( _ipAddressComboBox . Items [ _ipAddressComboBox . SelectedIndex ] . ToString ( ) , port , _scriptFile , _logger , _compilerOptions , _serverConfig ) ;
100
105
_server . Start ( _ipAddressComboBox . Items [ _ipAddressComboBox . SelectedIndex ] . ToString ( ) , port ) ;
101
106
}
102
107
@@ -143,6 +148,7 @@ private void OnChooseConfigFileButtonClick(Object sender, EventArgs args)
143
148
if ( file != String . Empty )
144
149
{
145
150
_configFile = file ;
151
+ _serverConfigBox . Text = file ;
146
152
DisplayConfig ( ) ;
147
153
_configChanged = true ;
148
154
}
@@ -156,6 +162,7 @@ private void OnChooseCompilerOptionsFileButtonClick(Object sender, EventArgs arg
156
162
if ( file != String . Empty )
157
163
{
158
164
_compilerOptionsFile = file ;
165
+ _compilerOptionsTextBox . Text = file ;
159
166
}
160
167
}
161
168
@@ -229,6 +236,7 @@ private void ApplyLogLevel()
229
236
private String _configFile ;
230
237
private String _compilerOptionsFile ;
231
238
private TcpServerConfig _serverConfig = new TcpServerConfig ( ) ;
239
+ private CompilerOptions _compilerOptions ;
232
240
private Boolean _configChanged = false ;
233
241
private RichTextBoxAppender _richTextBoxAppender ;
234
242
private readonly System . Threading . Timer [ ] _timers = new System . Threading . Timer [ 1 ] ;
0 commit comments