コード例 #1
0
ファイル: CommonProjectNode.cs プロジェクト: rsumner33/PTVS
        protected override int ExecCommandOnNode(Guid cmdGroup, uint cmd, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            if (cmdGroup == GuidList.guidPythonToolsCmdSet)
            {
                switch ((int)cmd)
                {
                case CommonConstants.AddSearchPathCommandId:
                    AddSearchPath();
                    return(VSConstants.S_OK);

                case CommonConstants.StartWithoutDebuggingCmdId:
                    EnvDTE.Project      automationObject = this.GetAutomationObject() as EnvDTE.Project;
                    string              activeConfigName = Utilities.GetActiveConfigurationName(automationObject);
                    CommonProjectConfig config           = MakeConfiguration(activeConfigName);
                    return(config.DebugLaunch((uint)__VSDBGLAUNCHFLAGS.DBGLAUNCH_NoDebug));
                }
            }
            else if (cmdGroup == Microsoft.PythonTools.Project.VsMenus.guidStandardCommandSet2K)
            {
                switch ((VsCommands2K)cmd)
                {
                case VsCommands2K.ECMD_PUBLISHSELECTION:
                case VsCommands2K.ECMD_PUBLISHSLNCTX:
                    Publish(PublishProjectOptions.Default, true);
                    return(VSConstants.S_OK);

                case CommonConstants.OpenFolderInExplorerCmdId:
                    Process.Start(this.ProjectDir);
                    return(VSConstants.S_OK);
                }
            }
            return(base.ExecCommandOnNode(cmdGroup, cmd, nCmdexecopt, pvaIn, pvaOut));
        }
コード例 #2
0
        void IPropertyPage.SetObjects(uint count, object[] punk)
        {
            if (punk == null)
            {
                return;
            }

            if (count > 0)
            {
                if (punk[0] is ProjectConfig)
                {
                    ArrayList configs = new ArrayList();

                    for (int i = 0; i < count; i++)
                    {
                        CommonProjectConfig config = (CommonProjectConfig)punk[i];

                        if (_project == null)
                        {
                            Project = (CommonProjectNode)config.ProjectMgr;
                            break;
                        }

                        configs.Add(config);
                    }
                }
                else if (punk[0] is NodeProperties)
                {
                    if (_project == null)
                    {
                        Project = (CommonProjectNode)(punk[0] as NodeProperties).Node.ProjectMgr;
                    }
                }
            }
            else
            {
                Project = null;
            }

            if (_project != null)
            {
                LoadSettings();
            }
        }