private void ReportDataMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.ReportTableData); var scriptMenuItem = new MenuItem { Header = "View Data as Report", Icon = ImageHelper.GetImageFromResource("../resources/Tables_8928.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; scriptMenuItem.CommandBindings.Add(scriptCommandBinding); Items.Add(scriptMenuItem); }
private void CreateScriptAsSelectMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.ScriptAsSelect); var scriptMenuItem = new MenuItem { Header = "Script as SELECT", Icon = ImageHelper.GetImageFromResource("../resources/sp.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; scriptMenuItem.CommandBindings.Add(scriptCommandBinding); Items.Add(scriptMenuItem); }
private void AddColumnMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var modifyTableCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.AddColumn); var modifyTableMenuItem = new MenuItem { Header = "Add column... (beta)", Icon = ImageHelper.GetImageFromResource("../resources/table_16xLG.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; modifyTableMenuItem.CommandBindings.Add(modifyTableCommandBinding); Items.Add(modifyTableMenuItem); }
private void CreateEditTableDataMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var editTableCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.EditTableData); var editTableMenuItem = new MenuItem { Header = string.Format("Edit Top {0} Rows", Properties.Settings.Default.MaxRowsToEdit), Icon = ImageHelper.GetImageFromResource("../resources/Editdatasetwithdesigner_8449.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; editTableMenuItem.CommandBindings.Add(editTableCommandBinding); Items.Add(editTableMenuItem); }
public TableContextMenu(MenuCommandParameters menuCommandParameters, ExplorerToolWindow parent) { var isSqlCe = menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLCE35 || menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLCE40; var tcmd = new TableMenuCommandsHandler(parent); //Edit menu CreateEditTableDataMenuItem(tcmd, menuCommandParameters); ReportDataMenuItem(tcmd, menuCommandParameters); AddSqlEditorItem(tcmd, menuCommandParameters); Items.Add(new Separator()); if (isSqlCe) { AddColumnMenuItem(tcmd, menuCommandParameters); AddIndexMenuItem(tcmd, menuCommandParameters); AddFkMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); } CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters); CreateScriptAsDropMenuItem(tcmd, menuCommandParameters); CreateScriptAsDropAndCreateMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); CreateScriptAsSelectMenuItem(tcmd, menuCommandParameters); CreateScriptAsInsertMenuItem(tcmd, menuCommandParameters); CreateScriptAsUpdateMenuItem(tcmd, menuCommandParameters); CreateScriptAsDeleteMenuItem(tcmd, menuCommandParameters); CreateScriptAsDataMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); ImportDataMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); if (isSqlCe) { CompareDataMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); } RenameMenuItem(tcmd, menuCommandParameters); if (isSqlCe) { DescriptionMenuItem(tcmd, menuCommandParameters); } }
public TableContextMenu(MenuCommandParameters menuCommandParameters, ExplorerControl parent) { var tcmd = new TableMenuCommandsHandler(parent); CreateEditDataMenuItem(tcmd, menuCommandParameters); CreateViewReportMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters); CreateScriptAsDropMenuItem(tcmd, menuCommandParameters); CreateScriptAsDropAndCreateMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); CreateScriptAsSelectMenuItem(tcmd, menuCommandParameters); CreateScriptAsInsertMenuItem(tcmd, menuCommandParameters); CreateScriptAsUpdateMenuItem(tcmd, menuCommandParameters); CreateScriptAsDeleteMenuItem(tcmd, menuCommandParameters); CreateScriptAsDataMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); ImportDataMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); DescriptionMenuItem(tcmd, menuCommandParameters); Items.Add(new Separator()); RenameMenuItem(tcmd, menuCommandParameters); }
private void DescriptionMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { Items.Add(new Separator()); var addDescriptionCommandBinding = new CommandBinding(DatabaseMenuCommands.DatabaseCommand, tcmd.AddDescription); var addDescriptionMenuItem = new MenuItem { Header = "Edit descriptions...", Icon = ImageHelper.GetImageFromResource("../resources/properties_16xLG.png"), Command = DatabaseMenuCommands.DatabaseCommand, CommandParameter = menuCommandParameters }; addDescriptionMenuItem.CommandBindings.Add(addDescriptionCommandBinding); Items.Add(addDescriptionMenuItem); }
private void RenameMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.Rename); var scriptMenuItem = new MenuItem { Header = "Rename...", Icon = ImageHelper.GetImageFromResource("../resources/Rename_6779.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; scriptMenuItem.CommandBindings.Add(scriptCommandBinding); Items.Add(scriptMenuItem); }
private void CompareDataMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.GenerateDataDiffScript); var scriptMenuItem = new MenuItem { Header = "Compare Data (beta)...", Icon = ImageHelper.GetImageFromResource("../resources/DataCompare_9880.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; scriptMenuItem.CommandBindings.Add(scriptCommandBinding); Items.Add(scriptMenuItem); }
private void ImportDataMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.ImportData); var scriptMenuItem = new MenuItem { Header = "Import Data from CSV...", Icon = ImageHelper.GetImageFromResource("../resources/TypeDefinition_521.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; scriptMenuItem.CommandBindings.Add(scriptCommandBinding); Items.Add(scriptMenuItem); }
private void CreateScriptAsDropAndCreateMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.ScriptAsDropAndCreate); var scriptMenuItem = new MenuItem { Header = "Script as DROP and CREATE", Icon = ImageHelper.GetImageFromResource("../resources/script_16xLG.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; scriptMenuItem.CommandBindings.Add(scriptCommandBinding); Items.Add(scriptMenuItem); }
private void AddSqlEditorItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var showSqlEditorCommandBinding = new CommandBinding(DatabaseMenuCommands.DatabaseCommand, tcmd.SpawnSqlEditorWindow); var showSqlEditorMenuItem = new MenuItem { Header = "New Query", Icon = ImageHelper.GetImageFromResource("../resources/NewQuery.png"), Command = DatabaseMenuCommands.DatabaseCommand, CommandParameter = menuCommandParameters }; showSqlEditorMenuItem.CommandBindings.Add(showSqlEditorCommandBinding); Items.Add(showSqlEditorMenuItem); }
private void AddFkMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var addFkCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.AddForeignKey); var addFkMenuItem = new MenuItem { Header = "Add foreign key... (beta)", Icon = ImageHelper.GetImageFromResource("../resources/table_16xLG.png"), Command = TableMenuCommands.TableCommand, CommandParameter = menuCommandParameters }; addFkMenuItem.CommandBindings.Add(addFkCommandBinding); Items.Add(addFkMenuItem); }
private void CreateViewReportMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var viewReportCommandBinding = new CommandBinding(DatabaseMenuCommands.DatabaseCommand, tcmd.SpawnReportViewerWindow); var reportMenuItem = new MenuItem { Header = "View Data as Report", Icon = ImageHelper.GetImageFromResource("../resources/sqlEditor.png"), Command = DatabaseMenuCommands.DatabaseCommand, CommandParameter = menuCommandParameters }; reportMenuItem.CommandBindings.Add(viewReportCommandBinding); Items.Add(reportMenuItem); }
private void CreateEditDataMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters) { var editTableCommandBinding = new CommandBinding(DatabaseMenuCommands.DatabaseCommand, tcmd.SpawnDataEditorWindow); var editTableMenuItem = new MenuItem { Header = string.Format("Edit Top {0} Rows", Properties.Settings.Default.MaxRowsToEdit), Icon = ImageHelper.GetImageFromResource("../resources/sqlEditor.png"), Command = DatabaseMenuCommands.DatabaseCommand, CommandParameter = menuCommandParameters }; editTableMenuItem.CommandBindings.Add(editTableCommandBinding); Items.Add(editTableMenuItem); }