コード例 #1
0
ファイル: Debugger.cs プロジェクト: jeason0813/cs-script.npp
        static public void RemoveAllBreakpoints()
        {
            foreach (var key in breakpoints.Keys)
            {
                Npp.DeleteMarker(breakpoints[key]);
                if (IsRunning)
                {
                    DebuggerServer.RemoveBreakpoint(key);
                }
            }
            breakpoints.Clear();

            foreach (string file in Npp.GetOpenFiles())
            {
                string dbgInfo = CSScriptHelper.GetDbgInfoFile(file, false);
                if (File.Exists(dbgInfo))
                {
                    File.Delete(dbgInfo);
                }
            }

            if (OnBreakpointChanged != null)
            {
                OnBreakpointChanged();
            }
        }
コード例 #2
0
        static public void SaveAllButNew()
        {
            //Win32.SendMessage(Npp.NppHandle, NppMsg.NPPM_SAVEALLFILES, 0, 0);

            var files   = Npp.GetOpenFiles();
            var current = Npp.GetCurrentFile();

            foreach (var item in files)
            {
                if (Path.IsPathRooted(item))  //the "new" file is not saved so it has no root
                {
                    Npp.OpenFile(item);
                    Win32.SendMessage(Npp.NppHandle, NppMsg.NPPM_SAVECURRENTFILE, 0, 0);
                }
            }
            Npp.OpenFile(current);
        }
コード例 #3
0
        static public void SaveDocuments(string[] files)
        {
            var filesToSave = files.Select(x => Path.GetFullPath(x));
            var openFiles   = Npp.GetOpenFiles();
            var current     = Npp.GetCurrentFile();

            foreach (var item in files)
            {
                if (Path.IsPathRooted(item))  //the "new" file is not saved so it has no root
                {
                    var path = Path.GetFullPath(item);
                    if (filesToSave.Contains(path))
                    {
                        Npp.OpenFile(item);
                        Win32.SendMessage(Npp.NppHandle, NppMsg.NPPM_SAVECURRENTFILE, 0, 0);
                    }
                }
            }
            Npp.OpenFile(current);
        }