本文整理汇总了C#中TagModel.PopTagStack方法的典型用法代码示例。如果您正苦于以下问题:C# TagModel.PopTagStack方法的具体用法?C# TagModel.PopTagStack怎么用?C# TagModel.PopTagStack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TagModel
的用法示例。
在下文中一共展示了TagModel.PopTagStack方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestPushingAndPoppingOfTagStack
public void TestPushingAndPoppingOfTagStack()
{
var model = new TagModel(new Reflection(new Hashtable()));
model.PushTagStack();
model.Tag["NewValue"] = "abc";
Assert.That(model.Tag["NewValue"], Is.EqualTo("abc"));
model.PushTagStack();
Assert.That(model.Tag["NewValue"], Is.Null);
model.Tag["NewValue"] = "def";
Assert.That(model.Tag["NewValue"], Is.EqualTo("def"));
model.PopTagStack();
Assert.That(model.Tag["NewValue"], Is.EqualTo("abc"));
}
示例2: TestTagStackWithUseOfPrefixSettingThroughModel
public void TestTagStackWithUseOfPrefixSettingThroughModel()
{
var model = new TagModel(new Reflection(new Hashtable()));
model.PushTagStack();
model["Tag.NewValue"] = "abc";
Assert.That(model["Tag.NewValue"], Is.EqualTo("abc"));
model.PushTagStack();
Assert.That(model["Tag.NewValue"], Is.Null);
model["Tag.NewValue"] = "def";
Assert.That(model["Tag.NewValue"], Is.EqualTo("def"));
model.PopTagStack();
Assert.That(model["Tag.NewValue"], Is.EqualTo("abc"));
}
示例3: TestFlatteningOfTagStackResolvingSettingThroughModel
public void TestFlatteningOfTagStackResolvingSettingThroughModel()
{
var model = new TagModel(new Reflection(new Hashtable()));
model.PushTagStack();
model["Tag.NewValue"] = "abc";
Assert.That(model["NewValue"], Is.EqualTo("abc"));
model.PushTagStack();
Assert.That(model["NewValue"], Is.Null);
model["Tag.NewValue"] = "def";
Assert.That(model["NewValue"], Is.EqualTo("def"));
model.PopTagStack();
Assert.That(model["NewValue"], Is.EqualTo("abc"));
}
示例4: SeachInTagScopeEmpyScopeTwoScopesValuesOverride
public void SeachInTagScopeEmpyScopeTwoScopesValuesOverride()
{
var model = new TagModel(new Reflection(new Hashtable()));
model.PushTagStack();
model.Tag["a"] = 0;
model.PushTagStack();
model.Tag["a"] = 1;
Assert.That(model.SearchInTagScope("a"), Is.EqualTo(1));
model.PopTagStack();
Assert.That(model.SearchInTagScope("a"), Is.EqualTo(0));
}
示例5: TagModel
public void PushTagWithPeekInParentShouldResolveParentValuesWithOutTrhowinngReflectionExceptionsOnUnknownPathsOnChild()
{
var model = new TagModel(new Reflection(new Hashtable()));
model.PushTagStack(true);
model["Tag.NewValue"] = "abc";
Assert.That(model["NewValue"], Is.EqualTo("abc"));
Assert.That(model["OtherValue"], Is.Null);
model.PushTagStack(true);
model["Tag.OtherValue"] = "def";
Assert.That(model["OtherValue"], Is.EqualTo("def"));
Assert.That(model["NewValue"], Is.EqualTo("abc"));
model.PopTagStack();
Assert.That(model["NewValue"], Is.EqualTo("abc"));
Assert.That(model["OtherValue"], Is.Null);
}
示例6: PushTagWithPeekInParentShouldResolveParentValues
public void PushTagWithPeekInParentShouldResolveParentValues()
{
var model = new TagModel(new Reflection(new Hashtable()));
model.PushTagStack(true);
model["Tag.NewValue"] = "abc";
Assert.That(model["NewValue"], Is.EqualTo("abc"));
model.PushTagStack(true);
Assert.That(model["NewValue"], Is.EqualTo("abc"));
model["Tag.NewValue"] = "def";
Assert.That(model["NewValue"], Is.EqualTo("def"));
model.PopTagStack();
Assert.That(model["NewValue"], Is.EqualTo("abc"));
}
示例7: Evaluate
public string Evaluate(TagModel model)
{
var builder = new StringBuilder();
IList list = ToList(GetIEnumerable(model));
int start = GetAutoValueAsInt("Begin", model).Value;
int end = GetAsInt(End, model) ?? list.Count;
int step = GetAutoValueAsInt("Step", model).Value;
string var = GetAutoValueAsString("Var", model);
string varStatus = GetAutoValueAsString("VarStatus", model);
model.PushTagStack();
var status = new ForEachStatus(list.Count, start, end);
if (list.Count > 0)
{
model.Tag[varStatus] = status;
for (int i = start; i < end; i += step)
{
status.Index = i;
model.Tag[var] = list[i];
builder.Append(GetAsString(Body, model) ?? String.Empty);
}
model.Tag[var] = null;
model.Tag[varStatus] = null;
}
model.PopTagStack();
return builder.ToString();
}