public void RefreshShortcuts()
 {
     foreach (ScriptEditorActions action in _actionKeys.Keys)
     {
         _actionKeys[action].ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(action);
     }
 }
Exemplo n.º 2
0
        private void InitializeActions_SearchAndReplaceOperations( )
        {
            #region Quick search forward
            Action ac = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.down;
            ac.Execute     += new EventHandler(OnAction_QuickSearchForward_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.SearchForward);
            _actionKeys.Add(ScriptEditorActions.SearchForward, ac);
            ac.Text = "Search Forward";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnFindNext, ac);
            _actionList.SetAction(mnuItemSearchForward, ac);

            #endregion

            #region Quick search backward
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.up;
            ac.Execute     += new EventHandler(OnAction_QuickSearchBackward_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.SearchBackward);
            _actionKeys.Add(ScriptEditorActions.SearchBackward, ac);
            ac.Text = "Search Backwards";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnFindPrev, ac);
            _actionList.SetAction(mnuItemSearchBackward, ac);
            #endregion

            #region GoTo Line
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.GoToLine);
            _actionKeys.Add(ScriptEditorActions.GoToLine, ac);
            ac.Execute += new EventHandler(OnAction_GoToLine_Execute);
            ac.Text     = "Go To Line";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemGoToLine, ac);
            #endregion

            #region Find
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Find);
            _actionKeys.Add(ScriptEditorActions.Find, ac);
            ac.Execute += new EventHandler(OnAction_Find_Execute);
            ac.Text     = "Find";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemFind, ac);
            #endregion

            #region Replace
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Replace);
            _actionKeys.Add(ScriptEditorActions.Replace, ac);
            ac.Execute += new EventHandler(OnAction_Replace_Execute);
            ac.Text     = "Replace";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemReplace, ac);
            #endregion
        }
Exemplo n.º 3
0
        private void InitializeActions_EditorOperations( )
        {
            #region  New script
            Action ac = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.new1;
            ac.Execute     += new EventHandler(OnAction_NewScript_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.NewScript);
            _actionKeys.Add(ScriptEditorActions.NewScript, ac);
            ac.Text = "New Script";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuNewScript, ac);
            #endregion

            #region  Close
            ac          = new Action();
            ac.Update  += new EventHandler(OnAction_Generic_Update);
            ac.Execute += new EventHandler(OnAction_Close_Execute);
            ac.Text     = "Close";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuItemClose, ac);

            #endregion

            #region Close All
            ac          = new Action();
            ac.Update  += new EventHandler(OnAction_Generic_Update);
            ac.Execute += new EventHandler(OnAction_CloseAll_Execute);
            ac.Text     = "Close All";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuCloseAll, ac);

            #endregion

            #region  Close All But This
            ac          = new Action();
            ac.Update  += new EventHandler(OnAction_Generic_Update);
            ac.Execute += new EventHandler(OnAction_CloseAllButThis_Execute);
            ac.Text     = "Close All But This";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuCloseAllButThis, ac);

            #endregion

            #region Toggle output pane
            ac              = new Action();
            ac.Execute     += new EventHandler(OnAction_ToggleOutputPane_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ToggleOutputPane);
            _actionKeys.Add(ScriptEditorActions.ToggleOutputPane, ac);
            ac.Text = "Toggle Output Pane";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemToggleOutputPane, ac);

            #endregion
        }
Exemplo n.º 4
0
        private void InitializeActions_ExecuteScriptOperations( )
        {
            #region Run Script
            Action ac = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.Run;
            ac.Update      += new EventHandler(OnAction_RunScript_Update);
            ac.Execute     += new EventHandler(OnAction_RunScript_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Execute);
            _actionKeys.Add(ScriptEditorActions.Execute, ac);
            ac.Text = "Execute";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnRun, ac);
            _actionList.SetAction(mnuItemRun, ac);

            #endregion

            #region Check syntax
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.correct;
            ac.Update      += new EventHandler(OnAction_CheckSyntax_Update);
            ac.Execute     += new EventHandler(OnAction_CheckSyntax_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.CheckSyntax);
            _actionKeys.Add(ScriptEditorActions.CheckSyntax, ac);
            ac.Text = "Check Syntax";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnCheckSyntax, ac);
            _actionList.SetAction(mnuItemCheckSyntax, ac);
            #endregion

            #region Show Plan
            ac          = new Action();
            ac.Image    = global::PragmaSQL.Properties.Resources.gear_1;
            ac.Update  += new EventHandler(OnAction_ShowPlan_Update);
            ac.Execute += new EventHandler(OnAction_ShowPlan_Execute);
            ac.Text     = "Show Plan";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnShowPlan, ac);
            _actionList.SetAction(mnuItemShowPlan, ac);
            #endregion

            #region Stop execution
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.Stop;
            ac.Update      += new EventHandler(OnAction_StopExecution_Update);
            ac.Execute     += new EventHandler(OnAction_StopExecution_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Stop);
            _actionKeys.Add(ScriptEditorActions.Stop, ac);
            ac.Text = "Stop";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnStop, ac);
            _actionList.SetAction(mnuItemStop, ac);

            #endregion
        }
Exemplo n.º 5
0
        private void InitializeActions_FileOperations( )
        {
            #region  Open file action
            Action ac = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.open;
            ac.Execute     += new EventHandler(OnAction_OpenFile_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Open);
            _actionKeys.Add(ScriptEditorActions.Open, ac);

            ac.Text = "Open File";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemOpen, ac);
            _actionList.SetAction(btnOpen, ac);
            #endregion

            #region Open New Editor from File
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.OpenNewFromFile);
            _actionKeys.Add(ScriptEditorActions.OpenNewFromFile, ac);

            ac.Execute += new EventHandler(OnAction_OpenFromFile_Execute);
            ac.Text     = "New From File";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuScriptFromFile, ac);

            #endregion

            #region Save file action
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.save;
            ac.Execute     += new EventHandler(OnAction_SaveFile_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Save);
            _actionKeys.Add(ScriptEditorActions.Save, ac);
            ac.Text = "Save File";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemSave, ac);
            _actionList.SetAction(btnSave, ac);
            _actionList.SetAction(cMnuItemSave, ac);

            #endregion

            #region Save file as action
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.SaveAs;
            ac.Execute     += new EventHandler(OnAction_SaveFileAs_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.SaveAs);
            _actionKeys.Add(ScriptEditorActions.SaveAs, ac);
            ac.Text = "Save File As";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemSaveAs, ac);
            _actionList.SetAction(btnSaveAs, ac);

            #endregion
        }
Exemplo n.º 6
0
 private void InitializeActions_WordAtCursorHelp()
 {
     Crad.Windows.Forms.Actions.Action ac = new Crad.Windows.Forms.Actions.Action();
     ac.Execute     += new EventHandler(OnAction_ShowHelpOnWordAtCursor_Execute);
     ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.HelpOnWordAtCursor);
     ac.Text         = "Help On WordAtCursor";
     _actionList.Actions.Add(ac);
     _actionList.SetAction(mnuItemHelpOnWordAtCursor, ac);
 }
        public static string ShortcutKeysAsStringFromAction(ScriptEditorActions action)
        {
            string result = String.Empty;

            Keys keys    = ScriptEditorShortcutKeysProvider.GetShortCut(action);
            Keys modKeys = Keys.Modifiers & keys;

            //Ctrl+Alt+Shift+M


            if ((Keys.Control & modKeys) == Keys.Control)
            {
                result += "Ctrl";
            }

            if ((Keys.Alt & modKeys) == Keys.Alt)
            {
                if (!String.IsNullOrEmpty(result))
                {
                    result += "+Alt";
                }
                else
                {
                    result += "Alt";
                }
            }

            if ((Keys.Shift & modKeys) == Keys.Shift)
            {
                if (!String.IsNullOrEmpty(result))
                {
                    result += "+Shift";
                }
                else
                {
                    result += "Shift";
                }
            }

            Keys key = Keys.KeyCode & keys;

            if (String.IsNullOrEmpty(result))
            {
                result += Enum.GetName(typeof(Keys), key);
            }
            else
            {
                result += "+" + Enum.GetName(typeof(Keys), key);
            }

            return(result);
        }
Exemplo n.º 8
0
        private void InitializeActions_EditorOperations( )
        {
            #region  New text editor
            Crad.Windows.Forms.Actions.Action ac = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.new1;
            ac.Execute     += new EventHandler(OnAction_NewScript_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.NewScript);
            _actionKeys.Add(ScriptEditorActions.NewScript, ac);
            ac.Text = "New Text Editor";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuNewScript, ac);
            #endregion

            #region  Close
            ac          = new Crad.Windows.Forms.Actions.Action();
            ac.Execute += new EventHandler(OnAction_Close_Execute);
            ac.Text     = "Close";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuItemClose, ac);

            #endregion

            #region Close All
            ac          = new Crad.Windows.Forms.Actions.Action();
            ac.Execute += new EventHandler(OnAction_CloseAll_Execute);
            ac.Text     = "Close All";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuCloseAll, ac);

            #endregion

            #region  Close All But This
            ac          = new Crad.Windows.Forms.Actions.Action();
            ac.Execute += new EventHandler(OnAction_CloseAllButThis_Execute);
            ac.Text     = "Close All But This";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuCloseAllButThis, ac);

            #endregion
        }
Exemplo n.º 9
0
        private void InitializeActions_ObjectHelpOperations( )
        {
            #region Modify Object
            Action ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ModifySelectedObject);
            _actionKeys.Add(ScriptEditorActions.ModifySelectedObject, ac);
            //ac.Update += new EventHandler(OnAction_ModifySelectedObject_Update);
            ac.Execute += new EventHandler(OnAction_ModifySelectedObject_Execute);

            ac.Text = "Modify";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemModifySelObject, ac);


            #endregion

            #region Execute Stored Proc
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.OpenProcExecScript);
            _actionKeys.Add(ScriptEditorActions.OpenProcExecScript, ac);
            ac.Execute += new EventHandler(OnAction_CreateExecScriptForSelectedProc_Execute);

            ac.Text = "Execute";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemExecProc, ac);


            #endregion

            #region Open Object
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.OpenSelectedObject);
            _actionKeys.Add(ScriptEditorActions.OpenSelectedObject, ac);
            ac.Execute += new EventHandler(OnAction_OpenSelectedObject_Execute);
            ac.Text     = "Open";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemOpenSelObject, ac);

            #endregion


            #region Permissions
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ListPermissions);
            _actionKeys.Add(ScriptEditorActions.ListPermissions, ac);
            ac.Execute += new EventHandler(OnAction_ListPermissions_Execute);
            ac.Text     = "Permissions";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemListPermissions, ac);

            #endregion

            #region References
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ListReferences);
            _actionKeys.Add(ScriptEditorActions.ListReferences, ac);
            ac.Execute += new EventHandler(OnAction_ListReferences_Execute);
            ac.Text     = "References";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemListReferences, ac);

            #endregion

            #region Dependencies
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ListDependencies);
            _actionKeys.Add(ScriptEditorActions.ListDependencies, ac);
            ac.Execute += new EventHandler(OnAction_ListDependencies_Execute);
            ac.Text     = "Dependencies";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemListDependencies, ac);

            #endregion

            #region Object Help
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ObjectHelp);
            _actionKeys.Add(ScriptEditorActions.ObjectHelp, ac);
            ac.Execute += new EventHandler(OnAction_ObjectHelp_Execute);
            ac.Text     = "Object Help";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemObjectHelp, ac);

            #endregion
        }
Exemplo n.º 10
0
        private void InitializeActions_ScriptEditOperations( )
        {
            #region Undo
            Action ac = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.undo;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Undo);
            _actionKeys.Add(ScriptEditorActions.Undo, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Undo_Execute);

            ac.Text = "Undo";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemUndo, ac);
            _actionList.SetAction(tsMnuItemUndo, ac);

            #endregion

            #region Redo
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.redo;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Redo);
            _actionKeys.Add(ScriptEditorActions.Redo, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Redo_Execute);

            ac.Text = "Redo";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemRedo, ac);
            _actionList.SetAction(tsMnuItemRedo, ac);

            #endregion

            #region Cut
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.cut_2;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Cut);
            _actionKeys.Add(ScriptEditorActions.Cut, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Cut_Execute);

            ac.Text = "Cut";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemCut, ac);
            _actionList.SetAction(tsMnuItemCut, ac);

            #endregion

            #region Copy
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.copy;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Copy);
            _actionKeys.Add(ScriptEditorActions.Copy, ac);
            ac.Update  += new EventHandler(OnAction_Copy_Update);
            ac.Execute += new EventHandler(OnAction_Copy_Execute);

            ac.Text = "Copy";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemCopy, ac);
            _actionList.SetAction(tsMnuItemCopy, ac);

            #endregion

            #region Paste
            ac              = new Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.copy;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Paste);
            _actionKeys.Add(ScriptEditorActions.Paste, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Paste_Execute);

            ac.Text = "Paste";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemPaste, ac);
            _actionList.SetAction(tsMnuItemPaste, ac);

            #endregion

            #region Copy grid to clipboard
            ac          = new Action();
            ac.Execute += new EventHandler(OnAction_CopyGridToClipboard_Execute);
            ac.Text     = "Copy To Clipboard";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(popUpItemCopyGridToClipboard, ac);
            #endregion
        }
Exemplo n.º 11
0
        private void InitializeActions_ScriptFormatOperations( )
        {
            #region Outdent
            Action ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.OutdentSelection);
            _actionKeys.Add(ScriptEditorActions.OutdentSelection, ac);
            ac.Image    = global::PragmaSQL.Properties.Resources.IndentRTL;
            ac.Execute += new EventHandler(OnAction_OutdentSelection_Execute);
            ac.Text     = "Outdent selection";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnOutDent, ac);

            #endregion

            #region Indent
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.IndentSelection);
            _actionKeys.Add(ScriptEditorActions.IndentSelection, ac);
            ac.Image    = global::PragmaSQL.Properties.Resources.Indent;
            ac.Execute += new EventHandler(OnAction_IndentSelection_Execute);
            ac.Text     = "Outdent selection";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnIndent, ac);

            #endregion

            #region Keywords to uppercase
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.KeywordsToUppercase);
            _actionKeys.Add(ScriptEditorActions.KeywordsToUppercase, ac);
            ac.Image    = global::PragmaSQL.Properties.Resources.font_increase;
            ac.Execute += new EventHandler(OnAction_KeywordsToUppercase_Execute);
            ac.Text     = "Keywords To Uppercase ";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnKeywordsToUppercase, ac);
            _actionList.SetAction(mnuItemKeywordsToUppercase, ac);

            #endregion

            #region Keywords to lowercase
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.KeywordsToLowercase);
            _actionKeys.Add(ScriptEditorActions.KeywordsToLowercase, ac);
            ac.Image    = global::PragmaSQL.Properties.Resources.font_decrease;
            ac.Execute += new EventHandler(OnAction_KeywordsToLowercase_Execute);
            ac.Text     = "Keywords To Lowercase ";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnKeywordsToLowercase, ac);
            _actionList.SetAction(mnuItemKeywordsToLowercase, ac);

            #endregion

            #region Capitalize keywords
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.CapitalizeKeywords);
            _actionKeys.Add(ScriptEditorActions.CapitalizeKeywords, ac);
            ac.Image    = global::PragmaSQL.Properties.Resources.font_capitalize;
            ac.Execute += new EventHandler(OnAction_CapitalizeKeywords_Execute);
            ac.Text     = "Captalize Keywords";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(btnCapitalizeKeywords, ac);
            _actionList.SetAction(mnuItemCapitilizeKeywords, ac);

            #endregion

            #region Script to uppercase
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ScriptToUppercase);
            _actionKeys.Add(ScriptEditorActions.ScriptToUppercase, ac);
            ac.Execute += new EventHandler(OnAction_ScriptToUppercase_Execute);
            ac.Text     = "Script To Uppercase";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemScriptToUppercase, ac);

            #endregion

            #region Script to lowercase
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ScriptToLowercase);
            _actionKeys.Add(ScriptEditorActions.ScriptToLowercase, ac);
            ac.Execute += new EventHandler(OnAction_ScriptToLowercase_Execute);
            ac.Text     = "Script To Lowercase";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemScriptToLowercase, ac);

            #endregion

            #region Mark selection as code block
            ac = new Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.MarkSelectionAsCodeBlock);
            _actionKeys.Add(ScriptEditorActions.MarkSelectionAsCodeBlock, ac);
            ac.Update  += new EventHandler(OnAction_MarkSelAsCodeBlock_Update);
            ac.Execute += new EventHandler(OnAction_MarkSelAsCodeBlock_Execute);
            ac.Text     = "Mark Selection As Code Block";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemMarkSelAsCodeBlock, ac);
            _actionList.SetAction(tsMnuItemMarkSelAsCodeBlock, ac);

            #endregion
        }
Exemplo n.º 12
0
        private void InitializeActions_ObjectHelpOperations()
        {
            #region Modify Object
            Crad.Windows.Forms.Actions.Action ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ModifySelectedObject);
            _actionKeys.Add(ScriptEditorActions.ModifySelectedObject, ac);
            //ac.Update += new EventHandler(OnAction_ModifySelectedObject_Update);
            ac.Execute += new EventHandler(OnAction_ModifySelectedObject_Execute);

            ac.Text = "Modify";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemModifySelObject, ac);


            #endregion

            #region Execute Stored Proc
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.OpenProcExecScript);
            _actionKeys.Add(ScriptEditorActions.OpenProcExecScript, ac);
            ac.Execute += new EventHandler(OnAction_CreateExecScriptForSelectedProc_Execute);

            ac.Text = "Execute";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemExecProc, ac);


            #endregion


            #region Select top 100 Rows
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.SelectTop100Rows);
            _actionKeys.Add(ScriptEditorActions.SelectTop100Rows, ac);
            ac.Execute += new EventHandler(OnAction_SelectTop100Rows);

            ac.Text = "Select Top 100 Rows";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemSelectTop100SelObject, ac);


            #endregion

            #region Open Object
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.OpenSelectedObject);
            _actionKeys.Add(ScriptEditorActions.OpenSelectedObject, ac);
            ac.Execute += new EventHandler(OnAction_OpenSelectedObject_Execute);
            ac.Text     = "Open";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemOpenSelObject, ac);

            #endregion

            #region Object change history
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ObjectChangeHistory);
            _actionKeys.Add(ScriptEditorActions.ObjectChangeHistory, ac);
            ac.Execute += new EventHandler(OnAction_ShowObjectChangeHist_Execute);

            ac.Text = "Object Change History";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemObjectChangeHist, ac);


            #endregion

            #region Permissions
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ListPermissions);
            _actionKeys.Add(ScriptEditorActions.ListPermissions, ac);
            ac.Execute += new EventHandler(OnAction_ListPermissions_Execute);
            ac.Text     = "Permissions";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemListPermissions, ac);

            #endregion

            #region References
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ListReferences);
            _actionKeys.Add(ScriptEditorActions.ListReferences, ac);
            ac.Execute += new EventHandler(OnAction_ListReferences_Execute);
            ac.Text     = "References";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemListReferences, ac);

            #endregion

            #region Dependencies
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ListDependencies);
            _actionKeys.Add(ScriptEditorActions.ListDependencies, ac);
            ac.Execute += new EventHandler(OnAction_ListDependencies_Execute);
            ac.Text     = "Dependencies";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemListDependencies, ac);

            #endregion

            #region Object Help
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.ObjectHelp);
            _actionKeys.Add(ScriptEditorActions.ObjectHelp, ac);
            ac.Execute += new EventHandler(OnAction_ObjectHelp_Execute);
            ac.Text     = "Object Help";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemObjectHelp, ac);

            #endregion

            #region Fast Script Preview
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.FastScriptPreview);
            _actionKeys.Add(ScriptEditorActions.FastScriptPreview, ac);
            ac.Execute += new EventHandler(OnAction_FastScriptPreview_Execute);
            ac.Text     = "Fast Script Preview";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemFastScriptPreview, ac);
            #endregion //Fast Script Preview
        }
Exemplo n.º 13
0
        private void InitializeActions_ScriptEditOperations()
        {
            #region Undo
            Crad.Windows.Forms.Actions.Action ac = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.undo;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Undo);
            _actionKeys.Add(ScriptEditorActions.Undo, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Undo_Execute);

            ac.Text = "Undo";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemUndo, ac);
            _actionList.SetAction(tsMnuItemUndo, ac);

            #endregion

            #region Redo
            ac              = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.redo;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Redo);
            _actionKeys.Add(ScriptEditorActions.Redo, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Redo_Execute);

            ac.Text = "Redo";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemRedo, ac);
            _actionList.SetAction(tsMnuItemRedo, ac);

            #endregion

            #region Cut
            ac              = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.cut_2;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Cut);
            _actionKeys.Add(ScriptEditorActions.Cut, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Cut_Execute);

            ac.Text = "Cut";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemCut, ac);
            _actionList.SetAction(tsMnuItemCut, ac);

            #endregion

            #region Copy
            ac              = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.copy;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Copy);
            _actionKeys.Add(ScriptEditorActions.Copy, ac);
            ac.Update  += new EventHandler(OnAction_Copy_Update);
            ac.Execute += new EventHandler(OnAction_Copy_Execute);

            ac.Text = "Copy";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemCopy, ac);
            _actionList.SetAction(tsMnuItemCopy, ac);


            #endregion

            #region Paste
            ac              = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.copy;
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Paste);
            _actionKeys.Add(ScriptEditorActions.Paste, ac);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Execute += new EventHandler(OnAction_Paste_Execute);

            ac.Text = "Paste";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemPaste, ac);
            _actionList.SetAction(tsMnuItemPaste, ac);

            #endregion


            #region Block Comment
            ac          = new Crad.Windows.Forms.Actions.Action();
            ac.Execute += new EventHandler(OnAction_ToggleBlockComment_Execute);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Image    = Properties.Resources.CommentOut;
            ac.Text     = "Toggle Block Comment";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(btnToggleBlockComment, ac);

            #endregion //Block Comment

            #region Line Comment
            ac          = new Crad.Windows.Forms.Actions.Action();
            ac.Image    = Properties.Resources.CommentOut_Line;
            ac.Execute += new EventHandler(OnAction_ToggleLineComment_Execute);
            ac.Update  += new EventHandler(OnAction_TextEditor_Update);
            ac.Text     = "Toggle Line Comment";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(btnToggleLineComment, ac);
            #endregion //Line Comment
        }
Exemplo n.º 14
0
        private void InitializeActions_FileOperations()
        {
            #region  Open file action
            Crad.Windows.Forms.Actions.Action ac = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.open;
            ac.Update      += new EventHandler(OnAction_Generic_Update);
            ac.Execute     += new EventHandler(OnAction_OpenFile_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Open);
            _actionKeys.Add(ScriptEditorActions.Open, ac);

            ac.Text = "Load From File";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemOpen, ac);
            _actionList.SetAction(btnOpen, ac);
            #endregion

            #region Open New Editor from File
            ac = new Crad.Windows.Forms.Actions.Action();
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.OpenNewFromFile);
            _actionKeys.Add(ScriptEditorActions.OpenNewFromFile, ac);

            ac.Update  += new EventHandler(OnAction_Generic_Update);
            ac.Execute += new EventHandler(OnAction_OpenFromFile_Execute);
            ac.Text     = "Open File In New Editor";
            ac.Image    = Properties.Resources.folder_page_white;
            _actionList.Actions.Add(ac);

            _actionList.SetAction(cMnuScriptFromFile, ac);

            #endregion

            #region Save file action
            ac              = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.save;
            ac.Update      += new EventHandler(OnAction_Generic_Update);
            ac.Execute     += new EventHandler(OnAction_SaveFile_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.Save);
            _actionKeys.Add(ScriptEditorActions.Save, ac);
            ac.Text = "Save Script";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemSave, ac);
            _actionList.SetAction(btnSave, ac);
            _actionList.SetAction(cMnuItemSave, ac);

            #endregion

            #region Save file as action
            ac              = new Crad.Windows.Forms.Actions.Action();
            ac.Image        = global::PragmaSQL.Properties.Resources.SaveAs;
            ac.Update      += new EventHandler(OnAction_Generic_Update);
            ac.Execute     += new EventHandler(OnAction_SaveFileAs_Execute);
            ac.ShortcutKeys = ScriptEditorShortcutKeysProvider.GetShortCut(ScriptEditorActions.SaveAs);
            _actionKeys.Add(ScriptEditorActions.SaveAs, ac);
            ac.Text = "Save Script As";
            _actionList.Actions.Add(ac);

            _actionList.SetAction(mnuItemSaveAs, ac);
            _actionList.SetAction(btnSaveAs, ac);

            #endregion

            #region Shared Script Operation

            ac         = new Crad.Windows.Forms.Actions.Action();
            ac.Image   = global::PragmaSQL.Properties.Resources.generic;
            ac.Update += new EventHandler(OnAction_Generic_Update);
            ac.Text    = "Shared Script Operation";
            _actionList.Actions.Add(ac);
            _actionList.SetAction(mnuItemSharedScriptOperations, ac);

            #endregion Shared Script Operation
        }