本文整理汇总了C#中Microsoft.Build.BuildEngine.BuildPropertyGroup.RemoveProperty方法的典型用法代码示例。如果您正苦于以下问题:C# BuildPropertyGroup.RemoveProperty方法的具体用法?C# BuildPropertyGroup.RemoveProperty怎么用?C# BuildPropertyGroup.RemoveProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.BuildPropertyGroup
的用法示例。
在下文中一共展示了BuildPropertyGroup.RemoveProperty方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: TestRemoveProperty2
public void TestRemoveProperty2 ()
{
BuildPropertyGroup bpg = new BuildPropertyGroup ();
bpg.SetProperty ("a", "b");
bpg.SetProperty ("c", "d");
bpg.RemoveProperty ((string) null);
}
示例3: TestRemoveProperty3
public void TestRemoveProperty3 ()
{
BuildPropertyGroup bpg = new BuildPropertyGroup ();
bpg.SetProperty ("a", "b");
bpg.SetProperty ("c", "d");
bpg.RemoveProperty ("value_not_in_group");
bpg.RemoveProperty (new BuildProperty ("name", "value"));
BuildProperty bp = bpg ["a"];
bpg.RemoveProperty (bp);
}
示例4: RemovePropertyByBuildPropertyWithNullProperty
public void RemovePropertyByBuildPropertyWithNullProperty()
{
BuildPropertyGroup group = new BuildPropertyGroup();
BuildProperty property = null;
group.RemoveProperty(property);
}
示例5: TestRemoveProperty1
public void TestRemoveProperty1 ()
{
BuildPropertyGroup bpg = new BuildPropertyGroup ();
bpg.RemoveProperty ((BuildProperty) null);
}
示例6: RemovePropertyByBuildPropertyOneOfSeveral
public void RemovePropertyByBuildPropertyOneOfSeveral()
{
BuildPropertyGroup group = new BuildPropertyGroup();
group.SetProperty("n1", "v1");
group.SetProperty("n2", "v2");
group.SetProperty("n3", "v3");
BuildProperty property = GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n2");
group.RemoveProperty(property);
Assertion.AssertEquals(2, group.Count);
Assertion.AssertEquals("v1", group["n1"].Value);
Assertion.AssertNull(group["n2"]);
Assertion.AssertEquals("v3", group["n3"].Value);
}
示例7: RemovePropertyByBuildPropertyAllOfSeveral
public void RemovePropertyByBuildPropertyAllOfSeveral()
{
BuildPropertyGroup group = new BuildPropertyGroup();
group.SetProperty("n1", "v1");
group.SetProperty("n2", "v2");
group.SetProperty("n3", "v3");
BuildProperty[] property = new BuildProperty[]
{
GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n1"),
GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n2"),
GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n3")
};
group.RemoveProperty(property[0]);
group.RemoveProperty(property[1]);
group.RemoveProperty(property[2]);
Assertion.AssertEquals(0, group.Count);
Assertion.AssertNull(group["n1"]);
Assertion.AssertNull(group["n2"]);
Assertion.AssertNull(group["n3"]);
}
示例8: RemovePropertyByNameThatIsAnEmptyString
public void RemovePropertyByNameThatIsAnEmptyString()
{
BuildPropertyGroup group = new BuildPropertyGroup();
group.SetProperty("n", "v");
group.RemoveProperty(String.Empty);
Assertion.AssertEquals(1, group.Count);
}
示例9: RemovePropertyByNameWhenNameIsNull
public void RemovePropertyByNameWhenNameIsNull()
{
BuildPropertyGroup group = new BuildPropertyGroup();
string name = null;
group.RemoveProperty(name);
}
示例10: RemovePropertyByNameOfANonExistingProperty
public void RemovePropertyByNameOfANonExistingProperty()
{
BuildPropertyGroup group = new BuildPropertyGroup();
group.SetProperty("n", "v");
group.RemoveProperty("not");
Assertion.AssertEquals(1, group.Count);
}
示例11: RemovePropertyByNameAllOfSeveral
public void RemovePropertyByNameAllOfSeveral()
{
BuildPropertyGroup group = new BuildPropertyGroup();
group.SetProperty("n1", "v1");
group.SetProperty("n2", "v2");
group.SetProperty("n3", "v3");
group.RemoveProperty("n1");
group.RemoveProperty("n2");
group.RemoveProperty("n3");
Assertion.AssertEquals(0, group.Count);
Assertion.AssertNull(group["n1"]);
Assertion.AssertNull(group["n2"]);
Assertion.AssertNull(group["n3"]);
}
示例12: CountAfterRemovingAllProperties
public void CountAfterRemovingAllProperties()
{
BuildPropertyGroup group = new BuildPropertyGroup();
group.SetProperty("n1", "v1");
group.SetProperty("n2", "v2");
group.SetProperty("n3", "v3");
group.RemoveProperty("n1");
group.RemoveProperty("n2");
group.RemoveProperty("n3");
Assertion.AssertEquals(0, group.Count);
}