Exemple #1
0
        public TriggerContextMenu(MenuCommandParameters menuCommandParameters, ExplorerToolWindow parent)
        {
            var tcmd = new TriggerMenuCommandsHandler(parent);

            CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropMenuItem(tcmd, menuCommandParameters);
        }
Exemple #2
0
        public IndexContextMenu(MenuCommandParameters menuCommandParameters, ExplorerControl parent)
        {
            var tcmd = new IndexMenuCommandsHandler(parent);

            CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropMenuItem(tcmd, menuCommandParameters);
            Items.Add(new Separator());
            CreateScriptAsStatisticsMenuItem(tcmd, menuCommandParameters);
        }
Exemple #3
0
        public ColumnContextMenu(MenuCommandParameters menuCommandParameters, ExplorerControl parent)
        {
            var tcmd = new ColumnMenuCommandsHandler(parent);

            CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsAlterMenuItem(tcmd, menuCommandParameters);
            Items.Add(new Separator());
            CreateDescriptionMenuItem(tcmd, menuCommandParameters);
        }
Exemple #4
0
        public ViewContextMenu(MenuCommandParameters menuCommandParameters, ExplorerToolWindow parent)
        {
            var tcmd = new ViewMenuCommandsHandler(parent);

            //TODO Why does the Report Viewer fail?
            //ReportDataMenuItem(tcmd, menuCommandParameters);
            //Items.Add(new Separator());
            CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropMenuItem(tcmd, menuCommandParameters);
        }
        public ViewContextMenu(MenuCommandParameters menuCommandParameters, ExplorerToolWindow parent)
        {
            var tcmd = new ViewMenuCommandsHandler(parent);

            CreateReportDataMenuItem(tcmd, menuCommandParameters);
            AddSqlEditorItem(tcmd, menuCommandParameters);
            Items.Add(new Separator());
            CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropAndCreateMenuItem(tcmd, menuCommandParameters);
        }
        public TableContextMenu(MenuCommandParameters menuCommandParameters, ExplorerToolWindow parent)
        {
            var isSqlCe = menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLCE35 ||
                          menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLCE40;
            var isSqlite = menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLite;

            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);
            if (!isSqlite)
            {
                CreateScriptAsDropAndCreateMenuItem(tcmd, menuCommandParameters);
            }
            Items.Add(new Separator());
            CreateScriptAsSelectMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsInsertMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsUpdateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDeleteMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDataMenuItem(tcmd, menuCommandParameters);
#if SSMS
            if (isSqlCe)
            {
                CreateScriptAsSQLCLRSampleMenuItem(tcmd, menuCommandParameters);
            }
#endif
            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);
            }
        }
Exemple #7
0
        private void CreateScriptAsAlterMenuItem(ColumnMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters)
        {
            var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.ScriptAsAlter);
            var scriptMenuItem       = new MenuItem
            {
                Header           = "Script as ALTER",
                Icon             = ImageHelper.GetImageFromResource("../resources/sp.png"),
                Command          = TableMenuCommands.TableCommand,
                CommandParameter = menuCommandParameters
            };

            scriptMenuItem.CommandBindings.Add(scriptCommandBinding);
            Items.Add(scriptMenuItem);
        }
Exemple #8
0
        private void CreateScriptAsStatisticsMenuItem(IndexMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters)
        {
            var scriptCommandBinding = new CommandBinding(IndexMenuCommands.IndexCommand, tcmd.ScriptAsStatistics);
            var scriptMenuItem       = new MenuItem
            {
                Header           = "Script as Statistics",
                Icon             = ImageHelper.GetImageFromResource("../resources/sp.png"),
                Command          = IndexMenuCommands.IndexCommand,
                CommandParameter = menuCommandParameters
            };

            scriptMenuItem.CommandBindings.Add(scriptCommandBinding);
            Items.Add(scriptMenuItem);
        }
        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 CreateScriptAsDropMenuItem(TriggerMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters)
        {
            var scriptCommandBinding = new CommandBinding(IndexMenuCommands.IndexCommand, tcmd.ScriptAsDrop);
            var scriptMenuItem       = new MenuItem
            {
                Header           = "Script as DROP",
                Icon             = ImageHelper.GetImageFromResource("../resources/script_16xLG.png"),
                Command          = IndexMenuCommands.IndexCommand,
                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 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 CreateScriptAsDataMenuItem(TableMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters)
        {
            var scriptCommandBinding = new CommandBinding(TableMenuCommands.TableCommand, tcmd.ScriptAsData);
            var scriptMenuItem       = new MenuItem
            {
                Header           = "Script as Data (INSERTs)",
                Icon             = ImageHelper.GetImageFromResource("../resources/script_16xLG.png"),
                Command          = TableMenuCommands.TableCommand,
                CommandParameter = menuCommandParameters
            };

            scriptMenuItem.CommandBindings.Add(scriptCommandBinding);
            Items.Add(scriptMenuItem);
        }
        public SubscriptionsContextMenu(MenuCommandParameters subsMenuCommandParameters, ExplorerToolWindow parent)
        {
            var dcmd = new SubscriptionsMenuCommandsHandler(parent);

            if (subsMenuCommandParameters.MenuItemType == MenuType.Manage)

            {
                var newSubsCommandBinding = new CommandBinding(SubscriptionsMenuCommands.SubscriptionCommand,
                                                               dcmd.NewSubscription);

                var newSubsMenuItem = new MenuItem
                {
                    Header           = "Manage Subscription...",
                    Icon             = ImageHelper.GetImageFromResource("../resources/arrow_Sync_16xLG.png"),
                    Command          = SubscriptionsMenuCommands.SubscriptionCommand,
                    CommandParameter = subsMenuCommandParameters,
                };
                newSubsMenuItem.CommandBindings.Add(newSubsCommandBinding);
                Items.Add(newSubsMenuItem);


                var dropSubsCommandBinding = new CommandBinding(SubscriptionsMenuCommands.SubscriptionCommand,
                                                                dcmd.DropSubscription);

                var dropSubsMenuItem = new MenuItem
                {
                    Header           = "Drop Subscription...",
                    Icon             = ImageHelper.GetImageFromResource("../resources/arrow_Sync_16xLG.png"),
                    Command          = SubscriptionsMenuCommands.SubscriptionCommand,
                    CommandParameter = subsMenuCommandParameters,
                };
                dropSubsMenuItem.CommandBindings.Add(dropSubsCommandBinding);
                Items.Add(dropSubsMenuItem);
            }
            else
            {
                var newSubsCommandBinding = new CommandBinding(SubscriptionsMenuCommands.SubscriptionCommand,
                                                               dcmd.NewSubscription);

                var newSubsMenuItem = new MenuItem
                {
                    Header           = "New Subscription...",
                    Icon             = ImageHelper.GetImageFromResource("../resources/arrow_Sync_16xLG.png"),
                    Command          = SubscriptionsMenuCommands.SubscriptionCommand,
                    CommandParameter = subsMenuCommandParameters,
                };
                newSubsMenuItem.CommandBindings.Add(newSubsCommandBinding);
                Items.Add(newSubsMenuItem);
            }
        }
        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 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);
        }
Exemple #19
0
        private void CreateDescriptionMenuItem(ColumnMenuCommandsHandler tcmd, MenuCommandParameters menuCommandParameters)
        {
            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 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 IndexContextMenu(MenuCommandParameters menuCommandParameters, ExplorerToolWindow parent)
        {
            var isSqlCe = menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLCE35 ||
                          menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLCE40;

            var tcmd = new IndexMenuCommandsHandler(parent);

            CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropMenuItem(tcmd, menuCommandParameters);
            if (isSqlCe)
            {
                Items.Add(new Separator());
                CreateScriptAsStatisticsMenuItem(tcmd, menuCommandParameters);
            }
        }
        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);
        }
        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);
        }
Exemple #24
0
        public ColumnContextMenu(MenuCommandParameters menuCommandParameters, ExplorerToolWindow parent)
        {
            if (menuCommandParameters.DatabaseInfo.DatabaseType == DatabaseType.SQLite)
            {
                return;
            }

            var tcmd = new ColumnMenuCommandsHandler(parent);

            CreateModifyColumnMenuItem(tcmd, menuCommandParameters);
            Items.Add(new Separator());
            CreateScriptAsCreateMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsDropMenuItem(tcmd, menuCommandParameters);
            CreateScriptAsAlterMenuItem(tcmd, menuCommandParameters);
            Items.Add(new Separator());
            CreateDescriptionMenuItem(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);
        }
        public ScopesContextMenu(MenuCommandParameters scopeMenuCommandParameters, ExplorerToolWindow parent)
        {
            var dcmd = new ScopesMenuCommandsHandler(parent);

            if (scopeMenuCommandParameters.MenuItemType == MenuType.Manage)

            {
                var dropScopeCommandBinding = new CommandBinding(ScopesMenuCommands.ScopeCommand,
                                                                 dcmd.DropScope);

                var dropScopeMenuItem = new MenuItem
                {
                    Header           = "Deprovision Scope...",
                    Icon             = ImageHelper.GetImageFromResource("../resources/action_Cancel_16xLG.png"),
                    Command          = ScopesMenuCommands.ScopeCommand,
                    CommandParameter = scopeMenuCommandParameters,
                };
                dropScopeMenuItem.CommandBindings.Add(dropScopeCommandBinding);
                Items.Add(dropScopeMenuItem);
            }
            else
            {
            }
        }