Created
March 21, 2012 17:06
-
-
Save motowilliams/2149583 to your computer and use it in GitHub Desktop.
VS Bouncer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using EnvDTE; | |
namespace VSBouncer | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var command = args[0]; | |
var solutionPath = args[1]; | |
DTE dte = (DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.10.0"); | |
var solution = dte.Solution; | |
var fullPath = System.IO.Path.GetFullPath(solutionPath); | |
if (command.Equals("open", StringComparison.OrdinalIgnoreCase)) | |
solution.Open(fullPath); | |
if (command.Equals("close", StringComparison.OrdinalIgnoreCase)) | |
solution.Close(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment