本文整理汇总了C#中Microsoft.Build.BuildEngine.BuildItem.HasMetadata方法的典型用法代码示例。如果您正苦于以下问题:C# BuildItem.HasMetadata方法的具体用法?C# BuildItem.HasMetadata怎么用?C# BuildItem.HasMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.BuildItem
的用法示例。
在下文中一共展示了BuildItem.HasMetadata方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VerifyHasMetaDataOnBuiltInMetadata
/// <summary>
/// Verifies HasMetadata for all Built In Metadata for a specific BuildItem
/// </summary>
/// <param name="item">The BuildItem you want to verify against</param>
private void VerifyHasMetaDataOnBuiltInMetadata(BuildItem item)
{
foreach (string s in builtInMetadataNames)
{
Assertion.AssertEquals(true, item.HasMetadata(s));
}
}
示例2: ConstructHasMetadata
public void ConstructHasMetadata()
{
BuildItem item = new BuildItem("m", "v");
Assertion.AssertEquals(false, item.HasMetadata("m"));
Assertion.AssertEquals(string.Empty, item.GetEvaluatedMetadata("m"));
Assertion.AssertEquals(string.Empty, item.GetMetadata("m"));
Assertion.AssertEquals(builtInMetadataNames.Length, item.MetadataCount);
Assertion.AssertEquals(0, item.CustomMetadataCount);
}
示例3: SetMetadataSimple
public void SetMetadataSimple()
{
BuildItem item = new BuildItem("n", "i");
item.SetMetadata("m", "v");
Assertion.AssertEquals(true, item.HasMetadata("m"));
Assertion.AssertEquals("v", item.GetMetadata("m"));
}
示例4: TestRemoveMetadata1
public void TestRemoveMetadata1 ()
{
string itemName = "a";
string itemInclude = "a";
string metadataName = "name";
string metadataValue = "a;b;c";
item = new BuildItem (itemName, itemInclude);
item.SetMetadata (metadataName, metadataValue);
Assert.AreEqual (true, item.HasMetadata (metadataName), "A1");
item.RemoveMetadata (metadataName);
Assert.AreEqual (false, item.HasMetadata (metadataName), "A2");
}
示例5: TestHasMetadata3
public void TestHasMetadata3 ()
{
item = new BuildItem ("name", "spec");
item.HasMetadata (null);
}
示例6: TestHasMetadata1
public void TestHasMetadata1 ()
{
string itemName = "a";
string itemInclude = "a";
string metadataName = "name";
item = new BuildItem (itemName, itemInclude);
Assert.AreEqual (false, item.HasMetadata (metadataName), "A1");
item.SetMetadata (metadataName, "value");
Assert.AreEqual (true, item.HasMetadata (metadataName), "A2");
Assert.IsTrue (item.HasMetadata ("FullPath"), "A3");
Assert.IsTrue (item.HasMetadata ("RootDir"), "A4");
Assert.IsTrue (item.HasMetadata ("Filename"), "A5");
Assert.IsTrue (item.HasMetadata ("Extension"), "A6");
Assert.IsTrue (item.HasMetadata ("RelativeDir"), "A7");
Assert.IsTrue (item.HasMetadata ("Directory"), "A8");
Assert.IsTrue (item.HasMetadata ("RecursiveDir"), "A9");
Assert.IsTrue (item.HasMetadata ("Identity"), "A10");
Assert.IsTrue (item.HasMetadata ("ModifiedTime"), "A11");
Assert.IsTrue (item.HasMetadata ("CreatedTime"), "A12");
Assert.IsTrue (item.HasMetadata ("AccessedTime"), "A13");
}
示例7: CheckBuildItem
static void CheckBuildItem (BuildItem item, string name, string [,] metadata, string finalItemSpec, string prefix)
{
Assert.AreEqual (name, item.Name, prefix + "#1");
for (int i = 0; i < metadata.GetLength (0); i++) {
string key = metadata [i, 0];
string val = metadata [i, 1];
Assert.IsTrue (item.HasMetadata (key), String.Format ("{0}#2: Expected metadata '{1}' not found", prefix, key));
Assert.AreEqual (val, item.GetMetadata (key), String.Format ("{0}#3: Value for metadata {1}", prefix, key));
Assert.AreEqual (val, item.GetEvaluatedMetadata (key), String.Format ("{0}#4: Value for evaluated metadata {1}", prefix, key));
}
Assert.AreEqual (finalItemSpec, item.FinalItemSpec, prefix + "#5");
}