Пример #1
0
        private string ResolveStartupFile(CommonProjectNode project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }
            string startupFile = project.GetStartupFile();

            if (string.IsNullOrEmpty(startupFile))
            {
                //TODO: need to start active file then
                throw new ApplicationException("No startup file is defined for the startup project.");
            }
            return(startupFile);
        }
Пример #2
0
        /// <summary>
        /// Handles the menuitems
        /// </summary>
        protected override int QueryStatusOnNode(Guid guidCmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
        {
            if (guidCmdGroup == Microsoft.VisualStudio.Shell.VsMenus.guidStandardCommandSet2K)
            {
                switch ((VsCommands2K)cmd)
                {
                case VsCommands2K.EXCLUDEFROMPROJECT:
                case VsCommands2K.RUNCUSTOMTOOL:
                    result |= QueryStatusResult.NOTSUPPORTED | QueryStatusResult.INVISIBLE;
                    return(VSConstants.S_OK);
                }
            }
            else if (guidCmdGroup == GuidList.guidIronStudioCmdSet)
            {
                if (this.ProjectMgr.IsCodeFile(this.Url))
                {
                    switch (cmd)
                    {
                    case CommonConstants.SetAsStartupFileCmdId:
                        //We enable "Set as StartUp File" command only on current language code files,
                        //the file is in project home dir and if the file is not the startup file already.
                        string startupFile = _project.GetStartupFile();
                        if (IsInProjectHome() &&
                            (string.IsNullOrEmpty(startupFile) || !NativeMethods.IsSamePath(startupFile, this.Url)))
                        {
                            result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
                        }
                        break;

                    case CommonConstants.StartDebuggingCmdId:
                    case CommonConstants.StartWithoutDebuggingCmdId:
                        result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
                        break;
                    }
                }
                return(VSConstants.S_OK);
            }
            return(base.QueryStatusOnNode(guidCmdGroup, cmd, pCmdText, ref result));
        }