本文整理汇总了C#中Microsoft.Build.BuildEngine.BuildPropertyGroup.RevertAllOutputProperties方法的典型用法代码示例。如果您正苦于以下问题:C# BuildPropertyGroup.RevertAllOutputProperties方法的具体用法?C# BuildPropertyGroup.RevertAllOutputProperties怎么用?C# BuildPropertyGroup.RevertAllOutputProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.BuildPropertyGroup
的用法示例。
在下文中一共展示了BuildPropertyGroup.RevertAllOutputProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImportOutputProperties
public void ImportOutputProperties()
{
BuildPropertyGroup pg = new BuildPropertyGroup();
pg.SetProperty("foo", "fooval");
pg.SetProperty(new BuildProperty("bar", "barval", PropertyType.EnvironmentProperty));
pg.SetProperty(new BuildProperty("baz", "bazval", PropertyType.GlobalProperty));
pg.SetProperty(new BuildProperty("caz", "cazval", PropertyType.ImportedProperty));
pg.SetProperty(new BuildProperty("barb", "barbval", PropertyType.OutputProperty));
BuildPropertyGroup pgo = new BuildPropertyGroup();
pgo.SetProperty(new BuildProperty("foo", "fooout", PropertyType.OutputProperty));
pgo.SetProperty(new BuildProperty("bar", "barout", PropertyType.OutputProperty));
pgo.SetProperty(new BuildProperty("baz", "bazout", PropertyType.OutputProperty));
pgo.SetProperty(new BuildProperty("caz", "cazout", PropertyType.OutputProperty));
pgo.SetProperty(new BuildProperty("barb", "barbout", PropertyType.OutputProperty));
pgo.SetProperty(new BuildProperty("gaz", "gazout", PropertyType.OutputProperty));
pg.ImportProperties(pgo);
Assertion.AssertEquals(6, pg.Count);
Assertion.AssertEquals("fooout", pg["foo"].FinalValueEscaped);
Assertion.AssertEquals("barout", pg["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazout", pg["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazout", pg["caz"].FinalValueEscaped);
Assertion.AssertEquals("barbout", pg["barb"].FinalValueEscaped);
Assertion.AssertEquals("gazout", pg["gaz"].FinalValueEscaped);
pg.SetProperty(new BuildProperty("foo", "fooout2", PropertyType.OutputProperty));
pg.SetProperty(new BuildProperty("gaz", "gazout2", PropertyType.OutputProperty));
Assertion.AssertEquals("fooout2", pg["foo"].FinalValueEscaped);
Assertion.AssertEquals("gazout2", pg["gaz"].FinalValueEscaped);
pg.RemoveProperty("baz");
pg.RevertAllOutputProperties();
Assertion.AssertEquals(3, pg.Count);
Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped);
Assertion.AssertNull(pg["baz"]);
Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped);
Assertion.AssertNull(pg["barb"]);
}
示例2: ClonePropertyGroup
public void ClonePropertyGroup()
{
BuildPropertyGroup pg = new BuildPropertyGroup();
pg.SetProperty("foo", "fooval");
pg.SetProperty(new BuildProperty("bar", "barval", PropertyType.EnvironmentProperty));
pg.SetProperty(new BuildProperty("baz", "bazval", PropertyType.GlobalProperty));
pg.SetProperty(new BuildProperty("caz", "cazval", PropertyType.ImportedProperty));
pg.SetProperty(new BuildProperty("barb", "barbval", PropertyType.OutputProperty));
pg.SetProperty(new BuildProperty("foo", "fooout", PropertyType.OutputProperty));
pg.SetProperty(new BuildProperty("barb", "barbout", PropertyType.OutputProperty));
pg.SetProperty(new BuildProperty("gaz", "gazout", PropertyType.OutputProperty));
pg.SetProperty(new BuildProperty("foo", "fooout2", PropertyType.OutputProperty));
BuildPropertyGroup pgsc = pg.Clone(false /* shallow clone */);
BuildPropertyGroup pgdc = pg.Clone(true /* deep clone */);
Assertion.AssertEquals(6, pg.Count);
Assertion.AssertEquals("fooout2", pg["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped);
Assertion.AssertEquals("barbout", pg["barb"].FinalValueEscaped);
Assertion.AssertEquals("gazout", pg["gaz"].FinalValueEscaped);
Assertion.AssertEquals(6, pgsc.Count);
Assertion.AssertEquals("fooout2", pgsc["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pgsc["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pgsc["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pgsc["caz"].FinalValueEscaped);
Assertion.AssertEquals("barbout", pgsc["barb"].FinalValueEscaped);
Assertion.AssertEquals("gazout", pgsc["gaz"].FinalValueEscaped);
Assertion.AssertEquals(6, pgdc.Count);
Assertion.AssertEquals("fooout2", pgdc["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pgdc["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pgdc["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pgdc["caz"].FinalValueEscaped);
Assertion.AssertEquals("barbout", pgdc["barb"].FinalValueEscaped);
Assertion.AssertEquals("gazout", pgdc["gaz"].FinalValueEscaped);
pg.RevertAllOutputProperties();
Assertion.AssertEquals(4, pg.Count);
Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped);
Assertion.AssertNull(pg["barb"]);
Assertion.AssertNull(pg["gaz"]);
Assertion.AssertEquals(6, pgsc.Count);
Assertion.AssertEquals("fooout2", pgsc["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pgsc["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pgsc["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pgsc["caz"].FinalValueEscaped);
Assertion.AssertEquals("barbout", pgsc["barb"].FinalValueEscaped);
Assertion.AssertEquals("gazout", pgsc["gaz"].FinalValueEscaped);
Assertion.AssertEquals(6, pgdc.Count);
Assertion.AssertEquals("fooout2", pgdc["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pgdc["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pgdc["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pgdc["caz"].FinalValueEscaped);
Assertion.AssertEquals("barbout", pgdc["barb"].FinalValueEscaped);
Assertion.AssertEquals("gazout", pgdc["gaz"].FinalValueEscaped);
pgsc.RevertAllOutputProperties();
Assertion.AssertEquals(4, pg.Count);
Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped);
Assertion.AssertNull(pg["barb"]);
Assertion.AssertNull(pg["gaz"]);
Assertion.AssertEquals(4, pgsc.Count);
Assertion.AssertEquals("fooval", pgsc["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pgsc["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pgsc["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pgsc["caz"].FinalValueEscaped);
Assertion.AssertNull(pgsc["barb"]);
Assertion.AssertNull(pgsc["gaz"]);
Assertion.AssertEquals(6, pgdc.Count);
Assertion.AssertEquals("fooout2", pgdc["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pgdc["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pgdc["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pgdc["caz"].FinalValueEscaped);
Assertion.AssertEquals("barbout", pgdc["barb"].FinalValueEscaped);
Assertion.AssertEquals("gazout", pgdc["gaz"].FinalValueEscaped);
pgdc.RevertAllOutputProperties();
Assertion.AssertEquals(4, pg.Count);
Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped);
Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped);
Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped);
Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped);
//.........这里部分代码省略.........