Skip to content

Commit 4b7306c

Browse files
committed
GUI ready to pass CompilerOptions to FlexibleTcpServer
1 parent 6014f7c commit 4b7306c

File tree

1 file changed

+11
-3
lines changed
  • GUI/MossbauerLab.TinyTcpServer.MnGUI/MossbauerLab.TinyTcpServer.MnGUI/View/Forms

1 file changed

+11
-3
lines changed

GUI/MossbauerLab.TinyTcpServer.MnGUI/MossbauerLab.TinyTcpServer.MnGUI/View/Forms/MainForm.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using log4net.Core;
1111
using log4net.Repository.Hierarchy;
1212
using MossbauerLab.TinyTcpServer.Core.Client;
13+
using MossbauerLab.TinyTcpServer.Core.Scripting;
1314
using MossbauerLab.TinyTcpServer.Core.Server;
1415
using MossbauerLab.TinyTcpServer.MnGUI.Factories;
1516
using MossbauerLab.TinyTcpServer.MnGUI.Helpers;
@@ -84,8 +85,10 @@ private void Start()
8485
{
8586
if (!String.IsNullOrEmpty(_configFile))
8687
_serverConfig = TcpServerConfigBuilder.Build(_configFile);
88+
if (!String.IsNullOrEmpty(_compilerOptionsFile))
89+
_compilerOptions = CompilerOptionsBuilder.Build(_compilerOptionsFile);
8790
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);
8992
else
9093
{
9194
MessageBox.Show(@"Can not start server, please select IP address, port and server script");
@@ -95,8 +98,10 @@ private void Start()
9598
}
9699
else
97100
{
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);
100105
_server.Start(_ipAddressComboBox.Items[_ipAddressComboBox.SelectedIndex].ToString(), port);
101106
}
102107

@@ -143,6 +148,7 @@ private void OnChooseConfigFileButtonClick(Object sender, EventArgs args)
143148
if (file != String.Empty)
144149
{
145150
_configFile = file;
151+
_serverConfigBox.Text = file;
146152
DisplayConfig();
147153
_configChanged = true;
148154
}
@@ -156,6 +162,7 @@ private void OnChooseCompilerOptionsFileButtonClick(Object sender, EventArgs arg
156162
if (file != String.Empty)
157163
{
158164
_compilerOptionsFile = file;
165+
_compilerOptionsTextBox.Text = file;
159166
}
160167
}
161168

@@ -229,6 +236,7 @@ private void ApplyLogLevel()
229236
private String _configFile;
230237
private String _compilerOptionsFile;
231238
private TcpServerConfig _serverConfig = new TcpServerConfig();
239+
private CompilerOptions _compilerOptions;
232240
private Boolean _configChanged = false;
233241
private RichTextBoxAppender _richTextBoxAppender;
234242
private readonly System.Threading.Timer[] _timers = new System.Threading.Timer[1];

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy