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


C# TagModel.SearchInTagScope方法代码示例

本文整理汇总了C#中TagModel.SearchInTagScope方法的典型用法代码示例。如果您正苦于以下问题:C# TagModel.SearchInTagScope方法的具体用法?C# TagModel.SearchInTagScope怎么用?C# TagModel.SearchInTagScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TagModel的用法示例。


在下文中一共展示了TagModel.SearchInTagScope方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckLoadingOfBundle

 public void CheckLoadingOfBundle()
 {
     var model = new TagModel(new Hashtable());
     var tag = new Bundle();
     tag.BaseName = new MockAttribute(new Constant("FormatTags/test"));
     Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
     Assert.That(model.SearchInTagScope(FormatConstants.BUNDLE), Is.Not.Null);
     Assert.That(model.SearchInTagScope(FormatConstants.BUNDLE) is ResourceBundle, Is.True);
     var bundle = (ResourceBundle) model.SearchInTagScope(FormatConstants.BUNDLE);
     Assert.That(bundle.BaseName, Is.EqualTo("FormatTags/test"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:11,代码来源:BundleTest.cs

示例2: TestSettingOfPrefix

 public void TestSettingOfPrefix()
 {
     var model = new TagModel(new Hashtable());
     var tag = new Bundle();
     tag.BaseName = new MockAttribute(new Constant("FormatTags/test"));
     tag.Prefix = new MockAttribute(new Constant("pre_"));
     Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
     var bundle = (ResourceBundle) model.SearchInTagScope(FormatConstants.BUNDLE);
     Assert.That(bundle.Prefix, Is.EqualTo("pre_"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:10,代码来源:BundleTest.cs

示例3: 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

示例4: SeachInTagScopeEmpyScopeThreeScopesValueInTheSecondScope

 public void SeachInTagScopeEmpyScopeThreeScopesValueInTheSecondScope()
 {
     var model = new TagModel(new Reflection(new Hashtable()));
     model.PushTagStack();
     model.PushTagStack();
     model.Tag["a"] = 1;
     model.PushTagStack();
     Assert.That(model.SearchInTagScope("a"), Is.EqualTo(1));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:9,代码来源:TagModelTest.cs

示例5: SeachInTagScopeEmpyScope

 public void SeachInTagScopeEmpyScope()
 {
     var model = new TagModel(new Reflection(new Hashtable()));
     Assert.That(model.SearchInTagScope("a"), Is.Null);
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:5,代码来源:TagModelTest.cs

示例6: GetBundle

 private IResourceBundle GetBundle(TagModel model)
 {
     IResourceBundle bundle;
     if (Bundle != null)
     {
         var bundleName = GetAsString(Bundle, model);
         bundle = (IResourceBundle) model[bundleName];
         if (bundle == null)
         {
             throw TagException.NoResourceBundleFoundUnder(bundleName).Decorate(Bundle.Context);
         }
     }
     else
     {
         bundle = (IResourceBundle) model.SearchInTagScope(FormatConstants.BUNDLE);
         bundle = bundle ?? (IResourceBundle) model.Global[FormatConstants.BUNDLE];
         if (bundle == null)
         {
             throw TagException.NoResourceBundleFoundInTagScope().Decorate(Context);
         }
     }
     return bundle;
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:23,代码来源:Message.cs

示例7: GetMessage

 public static object GetMessage(string key, TagModel model, params object[] replacements)
 {
     var bundle = (ResourceBundle) model.SearchInTagScope(FormatConstants.BUNDLE);
     return bundle.Get(key, model);
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:5,代码来源:ResourceBundle.cs


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