public HaShell(MainForm mainForm, ConsoleControl.ConsoleControl console) { this.console = console; this.mainForm = mainForm; this.console.OnConsoleInput += Console_OnConsoleInput; console.ClearOutput(); console.IsInputEnabled = true; if (console.IsHandleCreated) { Console_HandleCreated(null, null); } else { console.HandleCreated += Console_HandleCreated; } ThreadSafeLogger = delegate(string x) { if (console.InvokeRequired) { console.BeginInvoke((Action) delegate { ConsoleWriteLine(x); }); } else { ConsoleWriteLine(x); } }; }
private void RunNewTask(DataGridViewCellEventArgs e) { //开始新的任务 SetWorkingState(e); //SetCrawler(); kiwiConsole.ClearOutput(); fileId = 0; //tempGridview = dgvTaskCapture; master = SetCrawler(); kiwiThreadStatus = master.ThreadStatus; strExit = ""; timer.Start();//20151204暂时注释掉 //isKillTask = false; isWriteTaskOver = false; for (int i = 0; i < kiwiThreadStatus.Count(); i++) { strExit += "true"; } //if (ckbDetail2Mode.Checked) //{ // isDetailMode2 = true; //} //else //{ // isDetailMode2 = false; //} master.Crawl(); writeThread = new Thread(WriteToDB); writeThread.Start(); }
public HaShell(MainForm mainForm, ConsoleControl.ConsoleControl console) { this.console = console; this.mainForm = mainForm; this.console.OnConsoleInput += Console_OnConsoleInput; console.ClearOutput(); console.IsInputEnabled = true; if (console.IsHandleCreated) Console_HandleCreated(null, null); else console.HandleCreated += Console_HandleCreated; }