public static ActionResult AddCleanProjectTool(Session session) { session.Log("Begin AddCleanProjectTool"); // Read HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\External Tools var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0\External Tools", true); if (key != null) { // The number has the value for the next tool // If there are 5 tools, the number will be 6 var numTools = (int) key.GetValue("ToolNumKeys", 0); var tool = new ExternalTool { Args = "/D:$(SolutionDir) /Z /R", Command = Path.Combine(session["INSTALLLOCATION"], "CleanProject.exe"), Directory = string.Empty, Opt = 24, SourceKey = string.Empty, Title = "Clean, Remove Source Bindings and Zip Solution" }; ExternalTool.Write(key, numTools, tool); // Setup for the next tool key.SetValue("ToolNumKeys", numTools + 1); } session.Log("End AddCleanProjectTool"); return ActionResult.Success; }
public static ActionResult AddCleanProjectTool(Session session) { session.Log("Begin AddCleanProjectTool"); // Read HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\External Tools var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0\External Tools", true); if (key != null) { // The number has the value for the next tool // If there are 5 tools, the number will be 6 var numTools = (int)key.GetValue("ToolNumKeys", 0); var tool = new ExternalTool { Args = "/D:$(SolutionDir) /Z /R", Command = Path.Combine(session["INSTALLLOCATION"], "CleanProject.exe"), Directory = string.Empty, Opt = 24, SourceKey = string.Empty, Title = "Clean, Remove Source Bindings and Zip Solution" }; ExternalTool.Write(key, numTools, tool); // Setup for the next tool key.SetValue("ToolNumKeys", numTools + 1); } session.Log("End AddCleanProjectTool"); return(ActionResult.Success); }
internal static void Write(RegistryKey key, int num, ExternalTool et) { key.SetValue(ToolTitle(num), et.Title); key.SetValue(ToolSourceKey(num), CleanProjectSig); key.SetValue(ToolDir(num), et.Directory); key.SetValue(ToolCmd(num), et.Command); key.SetValue(ToolArg(num), et.Args); key.SetValue(ToolOpt(num), et.Opt, RegistryValueKind.DWord); }
internal static ExternalTool Read(RegistryKey key, int num) { var et = new ExternalTool { Title = (string)key.GetValue(ToolTitle(num)), SourceKey = (string)key.GetValue(ToolSourceKey(num)), Directory = (string)key.GetValue(ToolDir(num)), Command = (string)key.GetValue(ToolCmd(num)), Args = (string)key.GetValue(ToolArg(num)) }; return(et); }
public static ActionResult RemoveCleanProjectTool(Session session) { session.Log("Begin RemoveCleanProjectTool"); // Read HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\External Tools var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0\External Tools", true); if (key != null) { // The number has the value for the next tool // If there are 5 tools, the number will be 6 ExternalTool.Remove(key, (int)key.GetValue("ToolNumKeys", 0)); } session.Log("End RemoveCleanProjectTool"); return(ActionResult.Success); }
internal static ExternalTool Read(RegistryKey key, int num) { var et = new ExternalTool { Title = (string) key.GetValue(ToolTitle(num)), SourceKey = (string) key.GetValue(ToolSourceKey(num)), Directory = (string) key.GetValue(ToolDir(num)), Command = (string) key.GetValue(ToolCmd(num)), Args = (string) key.GetValue(ToolArg(num)) }; return et; }