void RegisterCommandEvents() { var runner = CsvCommandRunner.GetInstance(); runner.OnSuccess += Runner_OnSuccess; runner.OnError += Runner_OnError; }
void DisplayAll() { if (csv == null) { MessageBox.Show("请先打开文件"); return; } CsvCommandRunner.GetInstance().Run(csv, "select * where 1"); }
bool RunCommand(string s) { if (csv == null) { MessageBox.Show("请先打开文件"); return(false); } var runner = CsvCommandRunner.GetInstance(); var r = runner.Run(csv, s); return(r != null); }
private void Runner_OnSuccess(CsvCommand cmd, CsvCommandQueryResult result) { switch (cmd.CommandType) { case CsvCommandType.Select: lastSelectCommand = cmd; break; } switch (result.Type) { case CsvCommandQueryResultType.Csv: DisplayCsv(result.Csv); break; case CsvCommandQueryResultType.Int: if (lastSelectCommand != null) { CsvCommandRunner.GetInstance().Run(csv, lastSelectCommand); } UpdateText(); break; } }