Changed Client manager on Server

This commit is contained in:
Nicola Carminati
2019-05-17 09:33:53 +02:00
parent 1b377d0e36
commit 43b3d87ad6
12 changed files with 86 additions and 65 deletions
+8 -25
View File
@@ -1,4 +1,5 @@
using Step.Model;
using Step.Core;
using Step.Model;
using Step.Model.DTOModels;
using Step.NC;
using System;
@@ -132,7 +133,7 @@ namespace Step.UI
private void OpenUiButton_Click(object sender, EventArgs e)
{
//Open CMS Client
StartCMSClient(null);
ThreadsHandler.StartClientFromUI();
}
private void StopServerButton_Click(object sender, EventArgs e)
@@ -158,25 +159,6 @@ namespace Step.UI
MessageServices.Current.Publish(SEND_STOP_SERVER);
}
public static void StartCMSClient(string url)
{
//Setup the Path Variable
string CMSClientPath = "";
if (!ClientIsRunning())
{
// Check if the system is 64/32 bit
if (Environment.Is64BitOperatingSystem && File.Exists(CLIENT_PATH_64))
CMSClientPath = CLIENT_PATH_64;
else if (File.Exists(CLIENT_PATH_86))
CMSClientPath = CLIENT_PATH_86;
if (!String.IsNullOrEmpty(CMSClientPath))
Process.Start(CMSClientPath, url);
else
MessageBox.Show("CMS-Active Client not found");
}
}
private void InitializeMessageListeners()
{
MVVMListeners = new List<RegistrationInfo>
@@ -210,11 +192,12 @@ namespace Step.UI
StepNotifyIcon.ShowBalloonTip(1000, message.Title, message.Message, (ToolTipIcon.Error));
//ShowMessage on UI
TXTstatus.Text = "[" + DateTime.Now.ToString("T") + "] " + message.Message;
TXTstatus.Text = "[" + DateTime.Now.ToString("T") + "] " + message.Message;
// Notify user
if(MessageBox.Show(new Form { TopMost = true }, message.Message, message.Title, MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
MessageServices.Current.Publish(SEND_STOP_SERVER);
});
// Notify user
if(MessageBox.Show(message.Message, message.Title, MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
MessageServices.Current.Publish(SEND_STOP_SERVER);
}
}),
// NC status handler