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


C# BuildItem.GetEvaluatedMetadata方法代码示例

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


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

示例1: 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

示例2: TestGetEvaluatedMetadata1

		public void TestGetEvaluatedMetadata1 ()
		{
			string itemName = "a";
			string itemInclude = "a";
			string metadataName = "name";
			string metadataValue = "a;b;c";

			item = new BuildItem (itemName, itemInclude);

			Assert.AreEqual (String.Empty, item.GetEvaluatedMetadata (metadataName), "A1");

			item.SetMetadata (metadataName, metadataValue);

			Assert.AreEqual (metadataValue, item.GetEvaluatedMetadata (metadataName), "A2");
			Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("Identity"), "A3");
		}
开发者ID:GirlD,项目名称:mono,代码行数:16,代码来源:BuildItemTest.cs

示例3: TestSetMetadata3

		public void TestSetMetadata3 ()
		{
			item = new BuildItem ("name", "include");
			item.SetMetadata ("a", "$(A)");
			item.SetMetadata ("b", "$(A)", true);
			item.SetMetadata ("c", "$(A)", false);

			Assert.AreEqual ("$(A)", item.GetEvaluatedMetadata ("a"), "A1");
			Assert.AreEqual ("$(A)", item.GetEvaluatedMetadata ("b"), "A2");
			Assert.AreEqual ("$(A)", item.GetEvaluatedMetadata ("c"), "A3");
			Assert.AreEqual ("$(A)", item.GetMetadata ("a"), "A4");
			Assert.AreEqual (Utilities.Escape ("$(A)"), item.GetMetadata ("b"), "A5");
			Assert.AreEqual ("$(A)", item.GetMetadata ("c"), "A6");
		}
开发者ID:GirlD,项目名称:mono,代码行数:14,代码来源:BuildItemTest.cs

示例4: TestCopyCustomMetadataTo1

		public void TestCopyCustomMetadataTo1 ()
		{
			BuildItem source, destination;
			string itemName1 = "a";
			string itemName2 = "b";
			string itemInclude = "a;b;c";
			string metadataName = "name";
			string metadataValue = "value";

			source = new BuildItem (itemName1, itemInclude);
			destination = new BuildItem (itemName2, itemInclude);

			source.SetMetadata (metadataName, metadataValue);

			source.CopyCustomMetadataTo (destination);

			Assert.AreEqual (metadataValue, destination.GetMetadata (metadataName), "A1");
			Assert.AreEqual (metadataValue, destination.GetEvaluatedMetadata (metadataName), "A2");
		}
开发者ID:GirlD,项目名称:mono,代码行数:19,代码来源:BuildItemTest.cs

示例5: 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

示例6: EvaluateMetadata

		string EvaluateMetadata (BuildItem it, string metadata)
		{
			var d = it.GetEvaluatedMetadata (metadata);
			if (string.IsNullOrEmpty (d))
				return null;
			else
				return d;
		}
开发者ID:zenek-y,项目名称:monodevelop,代码行数:8,代码来源:MSBuildEngineV4.cs

示例7: GetEvaluatedMetadata

 public override IEnumerable<Tuple<string, string>> GetEvaluatedMetadata(BuildItem proj)
 {
     return proj.MetadataNames.Cast<string>().Select(k => Tuple.Create(k, proj.GetEvaluatedMetadata(k)));
 }
开发者ID:redrezo,项目名称:gradle-msbuild-plugin,代码行数:4,代码来源:MsbuildPlatform.cs

示例8: GetMetadata_EscapedItemSpec

		public void GetMetadata_EscapedItemSpec ()
		{
			string itemInclude = "a;b;c";
			string escapedItemInclude = Utilities.Escape (itemInclude);

			item = new BuildItem ("name", escapedItemInclude);
			Assert.IsTrue (item.GetMetadata ("FullPath").EndsWith (escapedItemInclude), "#1a");
			Assert.IsTrue (item.GetEvaluatedMetadata ("FullPath").EndsWith (itemInclude), "#1b");

			Assert.AreEqual (escapedItemInclude, item.GetMetadata ("FileName"), "#2b");
			Assert.AreEqual (itemInclude, item.GetEvaluatedMetadata ("FileName"), "#2b");

			Assert.AreEqual (escapedItemInclude, item.GetMetadata ("Identity"), "#3a");
			Assert.AreEqual ("a;b;c", item.GetEvaluatedMetadata ("Identity"), "#3b");
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:15,代码来源:BuildItemTest.cs


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