public void Execute(object sender, EventArgs args)
        {
            var dte2 = (DTE2)Package.GetGlobalService(typeof(SDTE));

            if (dte2 != null && dte2.ActiveDocument != null)
            {
                var launcher = new PowerShellProjectLauncher();
                launcher.LaunchFile(dte2.ActiveDocument.FullName, true);
            }
        }
示例#2
0
        public virtual void Execute(object sender, EventArgs args)
        {
            var dte2     = (DTE2)Package.GetGlobalService(typeof(SDTE));
            var launcher = new PowerShellProjectLauncher(_validator.Validate());

            var file = GetTargetFile(dte2);

            if (String.IsNullOrEmpty(file))
            {
                return;
            }

            Utilities.SaveDirtyFiles();

            launcher.LaunchFile(file, true, ScriptArgs != null ? ScriptArgs.ScriptArgs : null);
        }