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


C# BuildPropertyGroup.RevertAllOutputProperties方法代码示例

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

示例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);
//.........这里部分代码省略.........
开发者ID:nikson,项目名称:msbuild,代码行数:101,代码来源:PropertyGroup_Tests.cs


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