/// <summary>
        /// Adds an existing file to the project in response to the "Include In Project" command
        /// </summary>
        /// <param name="parentId">Hierarchy ItemID for the parent</param>
        /// <param name="path">absolute path to the file to add</param>
        /// <returns></returns>
        internal int AddFileItem(uint parentId, string path)
        {
            projectNode.AddNewFileNodeToHierarchy(
                parentId == VSConstants.VSITEMID_ROOT
                    ? projectNode
                    : projectNode.NodeFromItemId(parentId)
                , path);

            return(VSConstants.S_OK);
        }
Exemple #2
0
        /// <summary>
        /// Adds an existing file to the project in response to the "Include In Project" command
        /// </summary>
        /// <param name="parentID">Hierarchy ItemID for the parent</param>
        /// <param name="Path">absolute path to the file to add</param>
        /// <returns></returns>
        internal int AddFileItem(uint parentID, string Path)
        {
            Microsoft.VisualStudio.FSharp.ProjectSystem.HierarchyNode parent;
            if (parentID == VSConstants.VSITEMID_ROOT)
            {
                parent = projectNode;
            }
            else
            {
                parent = projectNode.NodeFromItemId(parentID);
            }

            var node = projectNode.AddNewFileNodeToHierarchy(parent, Path);

            return(VSConstants.S_OK);
        }