protected override int ExecCommandThatDependsOnSelectedNodes(Guid cmdGroup, uint cmdId, uint cmdExecOpt, IntPtr vaIn, IntPtr vaOut, CommandOrigin commandOrigin, IList <HierarchyNode> selectedNodes, out bool handled) { if (cmdGroup == Guids.NodejsNpmCmdSet) { try { NpmHelpers.GetPathToNpm(this.Project.GetNodejsProject().GetProjectProperty(NodejsConstants.NodeExePath)); } catch (NpmNotFoundException) { Nodejs.ShowNodejsNotInstalled(); handled = true; return(VSConstants.S_OK); } switch (cmdId) { case PkgCmdId.cmdidNpmManageModules: if (!ShowManageModulesCommandOnNode(selectedNodes)) { ModulesNode.ManageModules(); handled = true; return(VSConstants.S_OK); } var node = selectedNodes[0] as AbstractNpmNode; if (node != null) { var abstractNpmNode = node; abstractNpmNode.ManageNpmModules(); handled = true; return(VSConstants.S_OK); } break; } } return(base.ExecCommandThatDependsOnSelectedNodes(cmdGroup, cmdId, cmdExecOpt, vaIn, vaOut, commandOrigin, selectedNodes, out handled)); }
protected override int ExecCommandThatDependsOnSelectedNodes(Guid cmdGroup, uint cmdId, uint cmdExecOpt, IntPtr vaIn, IntPtr vaOut, CommandOrigin commandOrigin, IList <HierarchyNode> selectedNodes, out bool handled) { if (cmdGroup == Guids.NodejsNpmCmdSet) { try { NpmHelpers.GetPathToNpm( Nodejs.GetAbsoluteNodeExePath( ProjectHome, Project.GetNodejsProject().GetProjectProperty(NodeProjectProperty.NodeExePath) )); } catch (NpmNotFoundException) { Nodejs.ShowNodejsNotInstalled(); handled = true; return(VSConstants.S_OK); } switch (cmdId) { case PkgCmdId.cmdidNpmManageModules: if (!ShowManageModulesCommandOnNode(selectedNodes)) { ModulesNode.ManageModules(); handled = true; return(VSConstants.S_OK); } var node = selectedNodes[0] as AbstractNpmNode; if (node != null) { var abstractNpmNode = node; abstractNpmNode.ManageNpmModules(); handled = true; return(VSConstants.S_OK); } break; } } else if (cmdGroup == Guids.NodejsCmdSet) { switch (cmdId) { case PkgCmdId.cmdidSetAsNodejsStartupFile: // Set the StartupFile project property to the Url of this node SetProjectProperty( CommonConstants.StartupFile, CommonUtils.GetRelativeFilePath(ProjectHome, selectedNodes[0].Url) ); handled = true; return(VSConstants.S_OK); case PkgCmdId.cmdidAddFileCommand: NewFileMenuGroup.NewFileUtilities.CreateNewFile(projectNode: this, containerId: selectedNodes[0].ID); handled = true; return(VSConstants.S_OK); } } return(base.ExecCommandThatDependsOnSelectedNodes(cmdGroup, cmdId, cmdExecOpt, vaIn, vaOut, commandOrigin, selectedNodes, out handled)); }