private static void _DisplayTable(UniqueTable udt, bool more, ApplicationCommand cmd) { DataTable table = udt.Table; if (table == null) { return; } if (cmd.Has("json")) { cout.WriteLine(table.WriteJson(JsonStyle.Normal, excludeTableName: false)); return; } #if WINDOWS if (cmd.Has("edit")) { var editor = new Windows.TableEditor(udt); editor.ShowDialog(); return; } #endif int maxColumnWidth = Config.console.table.grid.MaxColumnWidth; table.ToConsole(vertical: cmd.IsVertical, more: more, outputDbNull: true, maxColumnWidth); }
private static void _DisplayTable(UniqueTable udt, bool more, Command cmd) { DataTable table = udt.Table; if (table == null) return; if (cmd.ToJson) { stdio.WriteLine(ToJson(table)); return; } if (cmd.ToCSharp) { string clss = cmd.GetValue("class"); stdio.WriteLine(ToCSharp(table, clss)); return; } if (cmd.Has("edit")) { var editor = new Windows.TableEditor(cmd.Configuration, udt); editor.ShowDialog(); return; } if (cmd.IsVertical) table.ToVConsole(more); else table.ToConsole(more); }
public void OpenEditor() { DataTable dt = null; if (SqlShell.LastResult is DataTable) { dt = SqlShell.LastResult as DataTable; } if (dt == null) { stdio.ErrorFormat("select table first"); return; } var editor = new Windows.TableEditor(mgr.Configuration, new UniqueTable(null, dt)); editor.ShowDialog(); }