示例#1
0
文件: MainForm.cs 项目: renyh1013/dp2
 void dp2Kernel_stop()
 {
     if (kernel_host != null)
     {
         kernel_host.Stop();
         kernel_host = null;
     }
 }
示例#2
0
文件: MainForm.cs 项目: renyh1013/dp2
        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;
        }