当前位置: 首页>>代码示例>>C#>>正文


C# HierarchyNode.GetRelationalName方法代码示例

本文整理汇总了C#中Microsoft.VisualStudio.Package.HierarchyNode.GetRelationalName方法的典型用法代码示例。如果您正苦于以下问题:C# HierarchyNode.GetRelationalName方法的具体用法?C# HierarchyNode.GetRelationalName怎么用?C# HierarchyNode.GetRelationalName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.VisualStudio.Package.HierarchyNode的用法示例。


在下文中一共展示了HierarchyNode.GetRelationalName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddDependentFileNodeToNode

        /// <summary>
        /// Add a dependent file node to the hierarchy
        /// </summary>
        /// <param name="item">msbuild item to add</param>
        /// <param name="parentNode">Parent Node</param>
        /// <returns>Added node</returns>
        private HierarchyNode AddDependentFileNodeToNode(Microsoft.Build.Evaluation.ProjectItem item, HierarchyNode parentNode)
        {
            FileNode node = this.CreateDependentFileNode(new ProjectElement(this, item, false));
            parentNode.AddChild(node);
            
            // Make sure to set the HasNameRelation flag on the dependent node if it is related to the parent by name
            if (!node.HasParentNodeNameRelation && String.Compare(node.GetRelationalName(), parentNode.GetRelationalName(), StringComparison.OrdinalIgnoreCase) == 0)
            {
                node.HasParentNodeNameRelation = true;
            }

            return node;
        }
开发者ID:bullshock29,项目名称:Wix3.6Toolset,代码行数:19,代码来源:projectnode.cs

示例2: AddNewFileNodeToHierarchy

        /// <summary>
        /// Adds a new file node to the hierarchy.
        /// </summary>
        /// <param name="parentNode">The parent of the new fileNode</param>
        /// <param name="fileName">The file name</param>
        protected virtual void AddNewFileNodeToHierarchy(HierarchyNode parentNode, string fileName)
        {
            HierarchyNode child;

            // In the case of subitem, we want to create dependent file node
            // and set the DependentUpon property
            if (this.canFileNodesHaveChilds && (parentNode is FileNode || parentNode is DependentFileNode))
            {
                child = this.CreateDependentFileNode(fileName);
                child.ItemNode.SetMetadata(ProjectFileConstants.DependentUpon, parentNode.ItemNode.GetMetadata(ProjectFileConstants.Include));

                // Make sure to set the HasNameRelation flag on the dependent node if it is related to the parent by name
                if (!child.HasParentNodeNameRelation && string.Compare(child.GetRelationalName(), parentNode.GetRelationalName(), StringComparison.OrdinalIgnoreCase) == 0)
                {
                    child.HasParentNodeNameRelation = true;
                }
            }
            else
            {
                //Create and add new filenode to the project
                child = this.CreateFileNode(fileName);
            }

            parentNode.AddChild(child);

            // TODO : Revisit the VSADDFILEFLAGS here. Can it be a nested project?
            this.tracker.OnItemAdded(fileName, VSADDFILEFLAGS.VSADDFILEFLAGS_NoFlags);
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:33,代码来源:ProjectNode.cs

示例3: AddNewFileNodeToHierarchyCore

        private HierarchyNode AddNewFileNodeToHierarchyCore(HierarchyNode parentNode, string fileName, string linkPath)
        {
            HierarchyNode child;

            // In the case of subitem, we want to create dependent file node
            // and set the DependentUpon property
            if (this.canFileNodesHaveChilds && (parentNode is FileNode || parentNode is DependentFileNode))
            {
                child = this.CreateDependentFileNode(fileName);
                child.ItemNode.SetMetadata(ProjectFileConstants.DependentUpon, parentNode.ItemNode.GetMetadata(ProjectFileConstants.Include));

                // Make sure to set the HasNameRelation flag on the dependent node if it is related to the parent by name
                if (!child.HasParentNodeNameRelation && String.Compare(child.GetRelationalName(), parentNode.GetRelationalName(), StringComparison.OrdinalIgnoreCase) == 0)
                {
                    child.HasParentNodeNameRelation = true;
                }
            }
            else
            {
                //Create and add new filenode to the project
                child = this.CreateFileNode(fileName);
                child.ItemNode.SetMetadata(ProjectFileConstants.Link, linkPath);
                if (!String.IsNullOrEmpty(linkPath))
                {
                    child.ExcludeNodeFromScc = true;
                }
            }

            parentNode.AddChild(child);

            return child;
        }
开发者ID:bullshock29,项目名称:Wix3.6Toolset,代码行数:32,代码来源:projectnode.cs

示例4: AddNewFileNodeToHierarchy

        /// <summary>
        /// Adds the new file node to hierarchy.
        /// </summary>
        /// <param name="parentNode">The parent node.</param>
        /// <param name="fileName">Name of the file.</param>
        protected override void AddNewFileNodeToHierarchy(HierarchyNode parentNode, string path)
        {
            // If a lua file is being added, try to find a related FrameXML node
            if (MultiverseInterfaceProjectNode.IsPythonFile(path))
            {
                // Try to find a FrameXML node with a matching relational name
                string fileName = Path.GetFileNameWithoutExtension(path);
                HierarchyNode childNode = this.FirstChild;

                // Iterate through the children
                while (childNode != null)
                {
                    // If this child is an XML node and its relational name matches, break out of the loop
                    if (childNode is MultiverseInterfaceXmlFileNode && String.Compare(childNode.GetRelationalName(), fileName, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        parentNode = childNode;
                        break;
                    }

                    // Move over to the next sibling
                    childNode = childNode.NextSibling;
                }
            }

            HierarchyNode child;

            if (this.CanFileNodesHaveChilds && (parentNode is FileNode || parentNode is DependentFileNode))
            {
                child = this.CreateDependentFileNode(path);
                child.ItemNode.SetMetadata(ProjectFileConstants.DependentUpon, parentNode.ItemNode.GetMetadata(ProjectFileConstants.Include));

                // Make sure to set the HasNameRelation flag on the dependent node if it is related to the parent by name
                if (String.Compare(child.GetRelationalName(), parentNode.GetRelationalName(), StringComparison.OrdinalIgnoreCase) == 0)
                {
                    child.HasParentNodeNameRelation = true;
                }
            }
            else
            {
                //Create and add new filenode to the project
                child = this.CreateFileNode(path);
            }

            parentNode.AddChild(child);

            this.Tracker.OnItemAdded(path, VSADDFILEFLAGS.VSADDFILEFLAGS_NoFlags);
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:52,代码来源:MultiverseInterfaceProjectNode.cs


注:本文中的Microsoft.VisualStudio.Package.HierarchyNode.GetRelationalName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。