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


C# BuildItem.HasMetadata方法代码示例

本文整理汇总了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));
     }
 }
开发者ID:nikson,项目名称:msbuild,代码行数:11,代码来源:BuildItem_Tests.cs

示例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);
        }
开发者ID:nikson,项目名称:msbuild,代码行数:10,代码来源:BuildItem_Tests.cs

示例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"));
        }
开发者ID:nikson,项目名称:msbuild,代码行数:8,代码来源:BuildItem_Tests.cs

示例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");
		}
开发者ID:GirlD,项目名称:mono,代码行数:17,代码来源:BuildItemTest.cs

示例5: TestHasMetadata3

		public void TestHasMetadata3 ()
		{
			item = new BuildItem ("name", "spec");
			item.HasMetadata (null);
		}
开发者ID:GirlD,项目名称:mono,代码行数:5,代码来源:BuildItemTest.cs

示例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");
		}
开发者ID:GirlD,项目名称:mono,代码行数:25,代码来源:BuildItemTest.cs

示例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");
		}
开发者ID:salloo,项目名称:mono,代码行数:12,代码来源:ProjectTest.cs


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