예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }
예제 #4
0
 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);
 }
예제 #5
0
        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);
            }
        }
예제 #6
0
 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);
 }
예제 #7
0
        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);
        }
예제 #8
0
 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);
 }
예제 #9
0
 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);
 }
예제 #10
0
 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);
 }
예제 #11
0
 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);
 }
예제 #12
0
 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);
 }
예제 #13
0
 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);
 }
예제 #14
0
 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);
 }
예제 #15
0
 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);
 }