Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

Commit 4f8c7e6

Browse files
committed
If config file was changed, it setting will applied on next run
1 parent 9e5ac5f commit 4f8c7e6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • GUI/MossbauerLab.TinyTcpServer.MnGUI/MossbauerLab.TinyTcpServer.MnGUI/View/Forms

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ private void Start()
9393
}
9494
else
9595
{
96-
// todo umv: if server config changed => re-create server
96+
if(_configChanged)
97+
_server = ServerFactory.Create(_ipAddressComboBox.Items[_ipAddressComboBox.SelectedIndex].ToString(), port, _scriptFile, _logger, _serverConfig);
9798
_server.Start(_ipAddressComboBox.Items[_ipAddressComboBox.SelectedIndex].ToString(), port);
9899
}
99100

@@ -141,6 +142,7 @@ private void OnChooseConfigFileButtonClick(Object sender, EventArgs args)
141142
{
142143
_configFile = file;
143144
DisplayConfig();
145+
_configChanged = true;
144146
}
145147
}
146148

@@ -213,6 +215,7 @@ private void ApplyLogLevel()
213215
private String _scriptFile;
214216
private String _configFile;
215217
private TcpServerConfig _serverConfig = new TcpServerConfig();
218+
private Boolean _configChanged = false;
216219
private RichTextBoxAppender _richTextBoxAppender;
217220
private readonly System.Threading.Timer[] _timers = new System.Threading.Timer[1];
218221
}

0 commit comments

Comments
 (0)