Example #1
0
        int IOleCommandTarget.Exec(ref Guid commandGroup, uint commandId, uint commandExecOpt, IntPtr variantIn, IntPtr variantOut)
        {
            if (commandGroup != PackageGuids.guidCookiecutterCmdSet)
            {
                return(VSConstants.E_FAIL);
            }

            // Commands that support parameters cannot be implemented via IMenuCommandService
            var hr = VSConstants.S_OK;

            switch (commandId)
            {
            case PackageIds.cmdidViewExternalWebBrowser:
                hr = ViewExternalBrowser(variantIn, variantOut, commandExecOpt);
                break;

            case PackageIds.cmdidCookiecutterExplorer:
                ShowWindowPane(typeof(CookiecutterToolWindow), true);
                break;

            case PackageIds.cmdidCreateFromCookiecutter:
                NewCookiecutterSession();
                break;

            case PackageIds.cmdidAddFromCookiecutter:
                NewCookiecutterSession(_projectSystem.GetSelectedFolderProjectLocation());
                break;

            default:
                Debug.Assert(false);
                break;
            }

            return(hr);
        }
Example #2
0
        public override void DoCommand(object sender, EventArgs args)
        {
            var location = _projectSystem.GetSelectedFolderProjectLocation();

            _package.NewCookiecutterSession(location);
        }