/// <summary> /// 创建本地Process /// </summary> /// <param name="serverExe"></param> /// <param name="parameter"></param> /// <param name="session"></param> internal void CreatNewProcess(string serverExe, string parameter, bool isShell, string session) { if (!File.Exists(serverExe)) { return; } RefreshList(); TabItem processTab = System.Windows.Markup.XamlReader.Parse(m_TabItemXaml) as TabItem; processTab.MouseDoubleClick += ProcessTab_MouseDoubleClick; TabControl_ServerLog.Items.Add(processTab); ServerProcess process = new ServerProcess(isShell, session); process.CreatTabWindow(TabControl_ServerLog, processTab); //在后台线程开始执行 BackgroundWorker processWorker = new BackgroundWorker(); processWorker.DoWork += ProcessWorker_DoWork; processWorker.RunWorkerCompleted += ProcessWorker_RunWorkerCompleted; processWorker.RunWorkerAsync(new object[] { process, serverExe, parameter }); }