Example #1
0
        public static void Start(System.Windows.Forms.Panel enginePanel)
        {
            if (mProcess != null)
            {
                throw new InvalidOperationException("Engine process already running");
            }

            ProcessInfo info;

            if (!PrepareProcessInfo(out info))
                throw new Exception("User aborted");

            if (!info.mExternalProcess)
            {
                LogService.Log("Starting engine");
                mProcess = new EngineProcess(info.mFileName, info.mWorkingDirectory, info.mSystemPath, enginePanel);
                mProcess.Start();
                LogService.Log("Engine started");
            }

            if (mNetworkService != null)
            {
                throw new InvalidOperationException("Network service running");
            }

            mNetworkService = new EngineNetworkService();

            mNetworkService.Connected += mNetworkService_Connected;

            mNetworkService.Start();
        }
Example #2
0
        public static void Stop()
        {
            if (mNetworkService != null)
            {
                mNetworkService.Stop();
                mNetworkService = null;
            }

            if(mProcess != null)
                mProcess.Stop();
        }