void dp2Kernel_stop() { if (kernel_host != null) { kernel_host.Stop(); kernel_host = null; } }
int dp2Kernel_start( bool bAutoStart, out string strError) { strError = ""; Debug.Assert(string.IsNullOrEmpty(this.KernelDataDir) == false, ""); string strFilename = Path.Combine(this.KernelDataDir, "databases.xml"); if (File.Exists(strFilename) == false) { strError = "dp2Kernel XE 尚未初始化"; return 0; } if (bAutoStart == true && kernel_host != null) { strError = "dp2Kernel 先前已经启动了"; return 0; } dp2Kernel_stop(); kernel_host = new KernelHost(); kernel_host.DataDir = this.KernelDataDir; int nRet = kernel_host.Start(out strError); if (nRet == -1) return -1; return 1; }