Inheritance: EnvDTE.Project, ISupportVSProperties
Exemplo n.º 1
0
        protected internal void RunVsTemplateWizard(ProjectElement element, bool silent)
        {
            ProjectElement elementToUse = (element == null) ? this.nestedProjectElement : element;

            if (elementToUse == null)
            {
                throw new ArgumentNullException("element");
            }
            this.nestedProjectElement = elementToUse;

            Automation.OAProject oaProject = GetAutomationObject() as Automation.OAProject;
            if (oaProject == null || oaProject.ProjectItems == null)
            {
                throw new System.InvalidOperationException(SR.GetString(SR.InvalidAutomationObject, CultureInfo.CurrentUICulture));
            }
            Debug.Assert(oaProject.Object != null, "The project automation object should have set the Object to the SolutionFolder");
            Automation.OASolutionFolder <ProjectContainerNode> folder = oaProject.Object as Automation.OASolutionFolder <ProjectContainerNode>;

            // Prepare the parameters to pass to RunWizardFile
            string destination = elementToUse.GetFullPathForElement();
            string template    = this.GetProjectTemplatePath(elementToUse);

            object[] wizParams = new object[7];
            wizParams[0] = EnvDTE.Constants.vsWizardAddSubProject;
            wizParams[1] = Path.GetFileNameWithoutExtension(destination);
            wizParams[2] = oaProject.ProjectItems;
            wizParams[3] = Path.GetDirectoryName(destination);
            wizParams[4] = Path.GetFileNameWithoutExtension(destination);
            wizParams[5] = Path.GetDirectoryName(folder.DTE.FullName);             //VS install dir
            wizParams[6] = silent;

            IVsDetermineWizardTrust wizardTrust = this.GetService(typeof(SVsDetermineWizardTrust)) as IVsDetermineWizardTrust;

            if (wizardTrust != null)
            {
                Guid guidProjectAdding = Guid.Empty;

                // In case of a project template an empty guid should be added as the guid parameter. See env\msenv\core\newtree.h IsTrustedTemplate method definition.
                ErrorHandler.ThrowOnFailure(wizardTrust.OnWizardInitiated(template, ref guidProjectAdding));
            }

            try
            {
                // Make the call to execute the wizard. This should cause AddNestedProjectFromTemplate to be
                // called back with the correct set of parameters.
                EnvDTE.IVsExtensibility extensibilityService = (EnvDTE.IVsExtensibility)GetService(typeof(EnvDTE.IVsExtensibility));
                EnvDTE.wizardResult     result = extensibilityService.RunWizardFile(template, 0, ref wizParams);
                if (result == EnvDTE.wizardResult.wizardResultFailure)
                {
                    throw new COMException();
                }
            }
            finally
            {
                if (wizardTrust != null)
                {
                    ErrorHandler.ThrowOnFailure(wizardTrust.OnWizardCompleted());
                }
            }
        }
Exemplo n.º 2
0
        public OAProjectItem(OAProject project, T node)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            this.node    = node;
            this.project = project;
        }
        public OANestedProjectItem(OAProject project, NestedProjectNode node)
            : base(project, node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            object nestedproject;

            if (ErrorHandler.Succeeded(node.NestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out nestedproject)))
            {
                this.nestedProject = nestedproject as EnvDTE.Project;
            }
        }
Exemplo n.º 4
0
        internal OANestedProjectItem(OAProject project, NestedProjectNode node)
            : base(project, node)
        {
            Utilities.ArgumentNotNull("node", node);

            object nestedproject;

            ThreadHelper.JoinableTaskFactory.Run(async delegate
            {
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
                if (ErrorHandler.Succeeded(node.NestedHierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ExtObject, out nestedproject)))
                {
                    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
                    this.nestedProject = nestedproject as EnvDTE.Project;
                }
            });
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="project">The associated project.</param>
 /// <param name="items">A list of items that will make up the items defined by this object.</param>
 /// <param name="nodeWithItems">The node that defines the items.</param>
 public OANavigableProjectItems(OAProject project, IList<EnvDTE.ProjectItem> items, HierarchyNode nodeWithItems)
 {
     this.items = items;
     this.project = project;
     this.nodeWithItems = nodeWithItems;
 }
Exemplo n.º 6
0
 public OAProjectItems(OAProject project, HierarchyNode nodeWithItems)
     : base(project, nodeWithItems)
 {
 }
Exemplo n.º 7
0
 public OAFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 8
0
 public OAReferenceFolderItem(OAProject project, ReferenceContainerNode node)
     : base(project, node)
 {
 }
 /// <summary>
 /// Public constructor.
 /// </summary>
 /// <param name="project">Automation project.</param>
 /// <param name="node">Custom file node.</param>
 public OAMyCustomProjectFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
 public OAIronPythonFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 11
0
 public NemerleOAReferenceFolderItem(OAProject project, ReferenceContainerNode node)
     : base(project, node)
 {
 }
Exemplo n.º 12
0
 internal OAReferenceItem(OAProject project, ReferenceNode node)
     : base(project, node)
 {
 }
Exemplo n.º 13
0
 /// <summary>
 /// Public constructor.
 /// </summary>
 /// <param name="project">Automation project.</param>
 /// <param name="node">Custom file node.</param>
 public OAXSharpFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 14
0
 public OAMac65ProjectFileItem(OAProject project, FileNode node) : base(project, node)
 {
 }
 /// <summary>
 /// Public constructor.
 /// </summary>
 /// <param name="project">Automation project.</param>
 /// <param name="node">Custom file node.</param>
 public OAUsagiProjectFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 16
0
 public NemerleOAReferenceItem(OAProject project, ReferenceNode node)
     : base(project, node)
 {
 }
Exemplo n.º 17
0
 /// <summary>
 /// Public constructor.
 /// </summary>
 /// <param name="project">Automation project.</param>
 /// <param name="node">Custom file node.</param>
 public OAVisualBasic6FileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 18
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="project">The associated project.</param>
 /// <param name="items">A list of items that will make up the items defined by this object.</param>
 /// <param name="nodeWithItems">The node that defines the items.</param>
 public OANavigableProjectItems(OAProject project, IList <EnvDTE.ProjectItem> items, HierarchyNode nodeWithItems)
 {
     this.items         = items;
     this.project       = project;
     this.nodeWithItems = nodeWithItems;
 }
Exemplo n.º 19
0
 internal OAFolderItem(OAProject project, FolderNode node)
     : base(project, node)
 {
 }
Exemplo n.º 20
0
 internal OAFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 21
0
 internal OAProjectItem(OAProject project, T node)
 {
     this.node    = node;
     this.project = project;
 }
Exemplo n.º 22
0
 public OAFolderItem(OAProject project, FolderNode node)
     : base(project, node)
 {
 }
Exemplo n.º 23
0
 internal OAProjectItems(OAProject project, HierarchyNode nodeWithItems)
     : base(project, nodeWithItems)
 {
 }
Exemplo n.º 24
0
 public OAProjectItem(OAProject project, T node)
 {
     this.node    = node;
     this.project = project;
 }
 /// <summary>
 /// Public constructor.
 /// </summary>
 /// <param name="project">Automation project.</param>
 /// <param name="node">Custom file node.</param>
 public OAIronRacketProjectFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 26
0
 public OAProjectItems(OAProject project, HierarchyNode nodeWithItems)
     : base(project, nodeWithItems)
 {
 }
Exemplo n.º 27
0
 public NemerleOAFolderItem(OAProject project, FolderNode node)
     : base(project, node)
 {
 }
Exemplo n.º 28
0
 public OAReferenceItem(OAProject project, ReferenceNode node)
     : base(project, node)
 {
 }
Exemplo n.º 29
0
 public NemerleOAFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
Exemplo n.º 30
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="project">The associated project.</param>
 /// <param name="nodeWithItems">The node that defines the items.</param>
 public OANavigableProjectItems(OAProject project, HierarchyNode nodeWithItems)
 {
     this.project = project;
     this.nodeWithItems = nodeWithItems;
     this.items = this.GetListOfProjectItems();
 }
Exemplo n.º 31
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="project">The associated project.</param>
 /// <param name="nodeWithItems">The node that defines the items.</param>
 public OANavigableProjectItems(OAProject project, HierarchyNode nodeWithItems)
 {
     this.project       = project;
     this.nodeWithItems = nodeWithItems;
     this.items         = this.GetListOfProjectItems();
 }
 public OAClojureProjectFileItem(OAProject project, FileNode node)
     : base(project, node)
 {
 }
 public OAAndroidProjectFileItem (OAProject project, FileNode node)
   : base (project, node)
 {
 }