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


C# ProjectItem.GetMetadataValue方法代码示例

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


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

示例1: GetProjectReferenceAdapter

 private ProjectReferenceAdapter GetProjectReferenceAdapter(ProjectItem r, bool conditionTrue)
 {
     var projectGuid = r.GetMetadataValue("Project");
     var csprojRelativePath = r.EvaluatedInclude;
     var absoluteProjectPath = Path.Combine(ProjectDirectory.FullName, csprojRelativePath);
     var referencedProjectAdapter = _projectLoader.GetProject(Guid.Parse(projectGuid), absoluteProjectPath);
     return new ProjectReferenceAdapter(referencedProjectAdapter, () => _project.RemoveItem(r), AddBinaryReferenceIfNotExists, conditionTrue);
 }
开发者ID:GrahamTheCoder,项目名称:NuGet.Extensions,代码行数:8,代码来源:ProjectAdapter.cs

示例2: GetTargetPath

 private string GetTargetPath(ProjectItem item)
 {
     string path = item.UnevaluatedInclude;
     if (item.HasMetadata("Link"))
     {
         path = item.GetMetadataValue("Link");
     }
     return Normalize(path);
 }
开发者ID:atheken,项目名称:nuget,代码行数:9,代码来源:ProjectFactory.cs

示例3: SpecialCharactersInMetadataValueTests

        /// <summary>
        /// Helper for SpecialCharactersInMetadataValue tests
        /// </summary>
        internal static void SpecialCharactersInMetadataValueTests(ProjectItem item)
        {
            Assert.Equal("%3B", item.GetMetadata("EscapedSemicolon").UnevaluatedValue);
            Assert.Equal("%3B", item.GetMetadata("EscapedSemicolon").EvaluatedValueEscaped);
            Assert.Equal(";", item.GetMetadata("EscapedSemicolon").EvaluatedValue);
            Assert.Equal("%3B", Project.GetMetadataValueEscaped(item, "EscapedSemicolon"));
            Assert.Equal(";", item.GetMetadataValue("EscapedSemicolon"));

            Assert.Equal("%24", item.GetMetadata("EscapedDollarSign").UnevaluatedValue);
            Assert.Equal("%24", item.GetMetadata("EscapedDollarSign").EvaluatedValueEscaped);
            Assert.Equal("$", item.GetMetadata("EscapedDollarSign").EvaluatedValue);
            Assert.Equal("%24", Project.GetMetadataValueEscaped(item, "EscapedDollarSign"));
            Assert.Equal("$", item.GetMetadataValue("EscapedDollarSign"));
        }
开发者ID:cdmihai,项目名称:msbuild,代码行数:17,代码来源:EscapingInProjects_Tests.cs

示例4: AssemblyReference

 public AssemblyReference(ProjectItem item)
 {
     _name = item.EvaluatedInclude;
     _hintPath = item.GetMetadataValue("HintPath");
 }
开发者ID:wbinford,项目名称:bottles,代码行数:5,代码来源:AssemblyReference.cs

示例5: ResolveProjectReferenceItemByAssemblyName

        private bool ResolveProjectReferenceItemByAssemblyName(ProjectItem reference, string mapping)
        {
            if (reference.HasMetadata("HintPath"))
            {
                var hintpath = reference.GetMetadataValue("HintPath");
                var fileInfo = new FileInfo(hintpath);
                return fileInfo.Name.Equals(mapping, StringComparison.OrdinalIgnoreCase);
            }

            return false;
        }
开发者ID:dipeshc,项目名称:NuGet.Extensions,代码行数:11,代码来源:Nugetify.cs

示例6: ToAsset

        Asset ToAsset(FileInfo file, ProjectItem item)
        {
            var buildAction = (AssetBuildActionKind) Enum.Parse(typeof(AssetBuildActionKind), item.ItemType);
            var name = item.GetMetadataValue("Name");
            var importer = item.GetMetadataValue("Importer");
            var processor = item.GetMetadataValue("Processor");
            if (processor == "PassThroughProcessor") processor = null;

            return new Asset(this, file, buildAction, name, importer, processor);
        }
开发者ID:willcraftia,项目名称:WindowsGame,代码行数:10,代码来源:ContentProject.cs


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