Пример #1
0
        private void ImportBreakpoints(string path)
        {
            if (!System.IO.File.Exists(path))
            {
                return;
            }

            breakPoints = ListXmlStore <BreakPoint> .Import(path);

            if (breakPoints.Count == 0)
            {
                return;
            }

            var cmd = new System.Text.StringBuilder();

            foreach (var breakPoint in breakPoints)
            {
                if (breakPoint.Enabled)
                {
                    cmd.AppendLine(string.Format("Set-PSBreakpoint -Line {0} -Script {1};", breakPoint.LineNumber, breakPoint.ScriptFullName));
                }
                else
                {
                    cmd.AppendLine(string.Format("Set-PSBreakpoint -Line {0} -Script {1} | Disable-PSBreakpoint;", breakPoint.LineNumber, breakPoint.ScriptFullName));
                }
            }
            hostObject.CurrentPowerShellTab.Invoke(cmd.ToString());
        }
Пример #2
0
        public void OpenFiles(string path)
        {
            if (!System.IO.File.Exists(path))
            {
                return;
            }

            files = ListXmlStore <string> .Import(path);

            foreach (var file in files)
            {
                try
                {
                    hostObject.CurrentPowerShellTab.Files.Add(file);
                }
                catch { }
            }
        }