|
|
|
@ -63,9 +63,10 @@ namespace ScadaTool.ViewModel
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 服务
|
|
|
|
|
var isTrue = true;
|
|
|
|
|
StartServiceCommand = new RelayCommand((_) =>
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
return isTrue;
|
|
|
|
|
}, (_) =>
|
|
|
|
|
{
|
|
|
|
|
string result = GoCSharpHelper.Instance().GoStringToCSharpString(run());
|
|
|
|
@ -73,6 +74,7 @@ namespace ScadaTool.ViewModel
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show("服务启动\n" + result);
|
|
|
|
|
icoPath = "Resources/icon.ico";
|
|
|
|
|
isTrue = false;
|
|
|
|
|
timer.Dispose();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -82,16 +84,16 @@ namespace ScadaTool.ViewModel
|
|
|
|
|
});
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region Go
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 引入Go项目库
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[DllImport("scadatool_go.dll", EntryPoint = "run")]
|
|
|
|
|
extern static GoString run();
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 属性
|
|
|
|
|
private string mToolTip = "服务未启动";
|
|
|
|
|