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


C# TagModel.PopTagStack方法代码示例

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

示例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"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:13,代码来源:TagModelTest.cs

示例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"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:13,代码来源:TagModelTest.cs

示例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));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:11,代码来源:TagModelTest.cs

示例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);
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:15,代码来源:TagModelTest.cs

示例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"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:13,代码来源:TagModelTest.cs

示例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();
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:26,代码来源:BaseIterationTag.cs


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