Пример #1
0
        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;
        }
Пример #2
0
        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);
        }
Пример #3
0
 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);
 }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
 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);
 }
Пример #7
0
        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;
        }