本文整理汇总了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);
}
示例2: GetTargetPath
private string GetTargetPath(ProjectItem item)
{
string path = item.UnevaluatedInclude;
if (item.HasMetadata("Link"))
{
path = item.GetMetadataValue("Link");
}
return Normalize(path);
}
示例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"));
}
示例4: AssemblyReference
public AssemblyReference(ProjectItem item)
{
_name = item.EvaluatedInclude;
_hintPath = item.GetMetadataValue("HintPath");
}
示例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;
}
示例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);
}