Exemplo n.º 1
0
        /// <summary>
        /// This method helps converting any non member node into the member one.
        /// </summary>
        /// <param name="node">Node to be added.</param>
        /// <returns>Returns the result of the conversion.</returns>
        /// <remarks>This method helps including the non-member items into the project when ShowAllFiles option is enabled.
        /// Normally, the project ignores "Add Existing Item" command if it is in ShowAllFiles mode and the non-member node
        /// exists for the item being added. Overriden to alter this behavior (now it includes the non-member node in the
        /// project)</remarks>
        protected override VSADDRESULT IncludeExistingNonMemberNode(HierarchyNode node)
        {
            IProjectSourceNode sourceNode = node as IProjectSourceNode;

            if (sourceNode != null && sourceNode.IsNonMemberItem)
            {
                if (sourceNode.IncludeInProject() == VSConstants.S_OK)
                {
                    return(VSADDRESULT.ADDRESULT_Success);
                }
            }

            return(base.IncludeExistingNonMemberNode(node));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the this node to the build system.
        /// </summary>
        /// <param name="recursive">Flag to indicate if the addition should be recursive.</param>
        protected virtual void AddToMSBuild(bool recursive)
        {
            if (ProjectManager == null || ProjectManager.IsClosed)
            {
                return; // do nothing
            }

            this.ItemNode = ProjectManager.AddFileToMSBuild(this.Url);
            this.SetProperty((int)__VSHPROPID.VSHPROPID_IsNonMemberItem, false);
            if (recursive)
            {
                for (HierarchyNode node = this.FirstChild; node != null; node = node.NextSibling)
                {
                    IProjectSourceNode sourceNode = node as IProjectSourceNode;
                    if (sourceNode != null)
                    {
                        sourceNode.IncludeInProject(recursive);
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Adds the this node to the build system.
        /// </summary>
        /// <param name="recursive">Flag to indicate if the addition should be recursive.</param>
        protected virtual void AddToMSBuild(bool recursive)
        {
            WixProjectNode projectNode = this.ProjectMgr as WixProjectNode;

            if (projectNode == null || projectNode.IsClosed)
            {
                return; // do nothing
            }

            this.ItemNode = projectNode.CreateMsBuildFolderProjectElement(this.Url);
            this.SetProperty((int)__VSHPROPID.VSHPROPID_IsNonMemberItem, false);
            if (recursive)
            {
                for (HierarchyNode node = this.FirstChild; node != null; node = node.NextSibling)
                {
                    IProjectSourceNode sourceNode = node as IProjectSourceNode;
                    if (sourceNode != null)
                    {
                        sourceNode.IncludeInProject(recursive);
                    }
                }
            }
        }