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


C# ProjectElement.GetMetadata方法代码示例

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


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

示例1: JavaFolderNode

        public JavaFolderNode(ProjectNode root, string relativePath, ProjectElement element)
            : base(root, relativePath, element)
        {
            Contract.Requires(root != null);
            Contract.Requires(relativePath != null);
            Contract.Requires(element != null);

            if (element.IsVirtual)
            {
                string buildAction = element.GetMetadata(ProjectFileConstants.BuildAction);
                if (buildAction == ProjectFileConstants.Folder)
                    this.IsNonmemberItem = false;
            }
        }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:14,代码来源:JavaFolderNode.cs

示例2: DartFolderNode

        public DartFolderNode(ProjectNode root, string relativePath, ProjectElement element)
            : base(root, relativePath, element)
        {
            if (root == null)
                throw new ArgumentNullException("root");
            if (relativePath == null)
                throw new ArgumentNullException("relativePath");
            if (element == null)
                throw new ArgumentNullException("element");

            if (element.IsVirtual)
            {
                string buildAction = element.GetMetadata(ProjectFileConstants.BuildAction);
                if (buildAction == ProjectFileConstants.Folder)
                    this.IsNonmemberItem = false;
            }
        }
开发者ID:modulexcite,项目名称:DartVS,代码行数:17,代码来源:DartFolderNode.cs

示例3: CreateFileNode

        /// <summary>
        /// Create a file node based on an msbuild item.
        /// </summary>
        /// <param name="item">The msbuild item to be analyzed</param>
        /// <returns>PythonFileNode or FileNode</returns>
        public override FileNode CreateFileNode(ProjectElement item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            string include = item.GetMetadata(ProjectFileConstants.Include);
            PythonFileNode newNode = new PythonFileNode(this, item);
            newNode.OleServiceProvider.AddService(typeof(EnvDTE.Project), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
            newNode.OleServiceProvider.AddService(typeof(EnvDTE.ProjectItem), newNode.ServiceCreator, false);
            if (!string.IsNullOrEmpty(include) && Path.GetExtension(include).Equals(".xaml", StringComparison.OrdinalIgnoreCase))
            {
                //Create a DesignerContext for the XAML designer for this file
                newNode.OleServiceProvider.AddService(typeof(DesignerContext), newNode.ServiceCreator, false);
            }
            newNode.OleServiceProvider.AddService(typeof(VSLangProj.VSProject), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
            if (IsCodeFile(include))
            {
                newNode.OleServiceProvider.AddService(
                    typeof(SVSMDCodeDomProvider), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
            }

            return newNode;
        }
开发者ID:kageyamaginn,项目名称:VSSDK-Extensibility-Samples,代码行数:30,代码来源:PythonProjectNode.cs

示例4: CreateDependentFileNode

        public override DependentFileNode CreateDependentFileNode(ProjectElement item)
        {
            DependentFileNode node = base.CreateDependentFileNode(item);
            if (null != node)
            {
                string include = item.GetMetadata(ProjectFileConstants.Include);
                if (IsCodeFile(include))
                {
                    node.OleServiceProvider.AddService(
                        typeof(SVSMDCodeDomProvider), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
                }
            }

            return node;
        }
开发者ID:kageyamaginn,项目名称:VSSDK-Extensibility-Samples,代码行数:15,代码来源:PythonProjectNode.cs

示例5: CreateFileNode

        /// <summary>
        /// Create a file node based on an msbuild item.
        /// </summary>
        /// <param name="item">The msbuild item to be analyzed</param>
        /// <returns>NemerleFileNode or FileNode</returns>
        public override FileNode CreateFileNode(ProjectElement item)
        {
            ErrorHelper.ThrowIsNull(item, "item");

            NemerleFileNode newNode = new NemerleFileNode(this, item, item.IsVirtual);

            string include = item.GetMetadata(ProjectFileConstants.Include);

            var provider = newNode.OleServiceProvider;

            provider.AddService(typeof(EnvDTE.Project), ProjectMgr.GetAutomationObject(), false);
            provider.AddService(typeof(EnvDTE.ProjectItem), newNode.ServiceCreator, false);
            provider.AddService(typeof(VSLangProj.VSProject), this.VSProject, false);

            if (!string.IsNullOrEmpty(include) && Path.GetExtension(include).Equals(".xaml", StringComparison.OrdinalIgnoreCase))
            {
                //Create a DesignerContext for the XAML designer for this file
                newNode.OleServiceProvider.AddService(typeof(DesignerContext), newNode.ServiceCreator, false);
            }

            if (newNode.IsFormSubType)
            {
                newNode.OleServiceProvider.AddService(typeof(DesignerContext), newNode.ServiceCreator, false);
            }

            if (item.ItemName == "Compile") // IsCodeFile(include) &&
                provider.AddService(typeof(SVSMDCodeDomProvider), new NemerleVSMDProvider(newNode), false);

            return newNode;
        }
开发者ID:vestild,项目名称:nemerle,代码行数:35,代码来源:NemerleProjectNode.cs

示例6: CreateDependentFileNode

        /// <summary>
        /// Create dependent file node based on an msbuild item
        /// </summary>
        /// <param name="item">msbuild item</param>
        /// <returns>dependent file node</returns>
        public override FileNode CreateDependentFileNode(ProjectElement item)
        {
            ErrorHelper.ThrowIsNull(item, "item");

            NemerleDependentFileNode newNode = new NemerleDependentFileNode(this, item);
            string include = item.GetMetadata(ProjectFileConstants.Include);

            var provider = newNode.OleServiceProvider;

            provider.AddService(typeof(EnvDTE.Project), ProjectMgr.GetAutomationObject(), false);
            provider.AddService(typeof(EnvDTE.ProjectItem), newNode.GetAutomationObject(), false);
            provider.AddService(typeof(VSLangProj.VSProject), this.VSProject, false);

            if (IsCodeFile(include) && item.ItemName == "Compile")
                newNode.OleServiceProvider.AddService(typeof(SVSMDCodeDomProvider),
                    new NemerleVSMDProvider(newNode), false);

            return newNode;
        }
开发者ID:vestild,项目名称:nemerle,代码行数:24,代码来源:NemerleProjectNode.cs

示例7: CreateFileNode

        /// <summary>
        /// Creates the file node.
        /// </summary>
        /// <param name="item">The project element item.</param>
        /// <returns></returns>
        public override FileNode CreateFileNode(ProjectElement item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            XSharpFileNode node = new XSharpFileNode(this, item);

            var provider = node.OleServiceProvider;

            // Use the CreateServices of the Project
            provider.AddService(typeof(EnvDTE.Project), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
            // Use the CreateServices of the Node
            provider.AddService(typeof(ProjectItem), node.ServiceCreator, false);
            // Use the CreateServices of the Project
            provider.AddService(typeof(VSProject), new OleServiceProvider.ServiceCreatorCallback(this.CreateServices), false);
            //provider.AddService(typeof(VSProject), this.VSProject, false);

            string include = item.GetMetadata(ProjectFileConstants.Include);
            if (!string.IsNullOrEmpty(include) && XSharpFileNode.GetFileType(include) == XSharpFileType.XAML)
            {
                //Create a DesignerContext for the XAML designer for this file
                // Use the CreateServices of the Node
                provider.AddService(typeof(DesignerContext), node.ServiceCreator, false);
            }

            if (node.IsFormSubType)
            {
                // Use the CreateServices of the Node
                provider.AddService(typeof(DesignerContext), node.ServiceCreator, false);
            }

            if (this.IsCodeFile(include) && item.ItemName == "Compile")
                provider.AddService(typeof(SVSMDCodeDomProvider), new XSharpVSMDProvider(node), false);


            return node;
        }
开发者ID:X-Sharp,项目名称:XSharpPublic,代码行数:44,代码来源:XSharpProjectNode.cs


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