示例#1
0
 static public void InitProjectPanel()
 {
     if (ProjectPanel == null)
     {
         ProjectPanel = ShowDockablePanel <ProjectPanel>("CS-Script", projectPanelId, NppTbMsg.DWS_DF_CONT_LEFT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR);
     }
     else
     {
         SetDockedPanelVisible(dockedManagedPanels[projectPanelId], projectPanelId, true);
     }
     ProjectPanel.Focus();
     Application.DoEvents();
 }
示例#2
0
        static public void InitProjectPanel()
        {
            if (ProjectPanel == null)
            {
                ProjectPanel = ShowDockablePanel <ProjectPanel>("CS-Script", projectPanelId, NppTbMsg.DWS_DF_CONT_LEFT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR);
            }
            else
            {
                bool requeredIsVisibleState = true;
                if (Config.Instance.UseTogglingPanelVisibility)
                {
                    requeredIsVisibleState = !ProjectPanel.Visible;
                }

                SetDockedPanelVisible(dockedManagedPanels[projectPanelId], projectPanelId, requeredIsVisibleState);
            }

            ProjectPanel.Focus();
            Application.DoEvents();
        }
示例#3
0
        static IEnumerable <Keys> BindInternalShortcuts()
        {
            var uniqueKeys = new Dictionary <Keys, int>();

            AddInternalShortcuts("Build:F7",
                                 "Build (validate)",
                                 Build, uniqueKeys);

            AddInternalShortcuts("LoadCurrentDocument:Ctrl+F7",
                                 "Load Current Document", () =>
            {
                InitProjectPanel();
                ShowProjectPanel();
                ProjectPanel.LoadCurrentDoc();
            }, uniqueKeys);

            AddInternalShortcuts("Stop:Shift+F5",
                                 "Stop running script",
                                 Stop, uniqueKeys);

            AddInternalShortcuts("_Run:F5",
                                 "Run",
                                 Run, uniqueKeys);

            AddInternalShortcuts("ShowNextFileLocationFromOutput:F4",
                                 "Next File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: true);
            }, uniqueKeys);

            AddInternalShortcuts("ShowPrevFileLocationFromOutput:Shift+F4",
                                 "Previous File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: false);
            }, uniqueKeys);

            return(uniqueKeys.Keys);
        }
示例#4
0
        static IEnumerable <Keys> BindInteranalShortcuts()
        {
            var uniqueKeys = new Dictionary <Keys, int>();

            AddInternalShortcuts("Build:F7",
                                 "Build (validate)",
                                 Build, uniqueKeys);

            AddInternalShortcuts("LoadCurrentDocument:Ctrl+F7",
                                 "Load Current Document", () =>
            {
                InitProjectPanel();
                ShowProjectPanel();
                ProjectPanel.LoadCurrentDoc();
            }, uniqueKeys);

            AddInternalShortcuts("Stop:Shift+F5",
                                 "Stop running script",
                                 Stop, uniqueKeys);

            AddInternalShortcuts("_Run:F5",
                                 "Run",
                                 Run, uniqueKeys);

            AddInternalShortcuts("_Debug:Alt+F5",
                                 "Debug", () =>
            {
                if (!Debugger.IsRunning && Npp.Editor.IsCurrentDocScriptFile())
                {
                    DebugScript();
                }
            }, uniqueKeys);

            AddInternalShortcuts("ToggleBreakpoint:F9",
                                 "Toggle Breakpoint",
                                 () => Debugger.ToggleBreakpoint(), uniqueKeys);

            AddInternalShortcuts("QuickWatch:Shift+F9",
                                 "Show QuickWatch...",
                                 QuickWatchPanel.PopupDialog, uniqueKeys);

            AddInternalShortcuts("StepInto:F11",
                                 "Step Into",
                                 Debugger.StepIn, uniqueKeys);

            AddInternalShortcuts("StepOut:Shift+F11",
                                 "Step Out",
                                 Debugger.StepOut, uniqueKeys);

            AddInternalShortcuts("StepOver:F10",
                                 "Step Over",
                                 StepOver, uniqueKeys);

            AddInternalShortcuts("SetNextIP:Ctrl+Shift+F10",
                                 "Set Next Statement",
                                 Debugger.SetInstructionPointer, uniqueKeys);

            AddInternalShortcuts("RunToCursor:Ctrl+F10",
                                 "Run To Cursor",
                                 Debugger.RunToCursor, uniqueKeys);

            AddInternalShortcuts("RunAsExternal:Ctrl+F5",
                                 "Run As External Process", () =>
            {
                if (Npp.Editor.IsCurrentDocScriptFile())
                {
                    RunAsExternal();
                }
            }, uniqueKeys);

            AddInternalShortcuts("ShowNextFileLocationFromOutput:F4",
                                 "Next File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: true);
            }, uniqueKeys);

            AddInternalShortcuts("ShowPrevFileLocationFromOutput:Shift+F4",
                                 "Previous File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: false);
            }, uniqueKeys);

            return(uniqueKeys.Keys);
        }