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