• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TagModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

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


示例2: SetUp

 public override void SetUp()
 {
     base.SetUp();
     var model = new Hashtable();
     _model = new TagModel(model);
     _model.Page[FormatConstants.LOCALE] = new CultureInfo("en-US");
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:NumberFormatTest.cs


示例3: SetUp

 public override void SetUp()
 {
     base.SetUp();
     var model = new Hashtable();
     _model = new TagModel(model);
     _model.Page[FormatConstants.LOCALE] = CultureInfo.InvariantCulture;
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:FormatDateTest.cs


示例4: NewTagViewController

 public NewTagViewController (WorkspaceModel workspace)
 {
     this.model = new TagModel () {
         Workspace = workspace,
     };
     Title = "NewTagTitle".Tr ();
 }
开发者ID:ZhangLeiCharles,项目名称:mobile,代码行数:7,代码来源:NewTagViewController.cs


示例5: GlobalResolveTest

 public void GlobalResolveTest()
 {
     var model = new TagModel(new Reflection(new Hashtable()));
     model.Global["ResolveNewValue"] = "abc";
     Assert.That(model.Global["ResolveNewValue"], Is.EqualTo("abc"));
     Assert.That(model["ResolveNewValue"], Is.EqualTo("abc"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:TagModelTest.cs


示例6: InternalEvaluate

 public override object InternalEvaluate(TagModel model)
 {
     string dateStr = GetAutoValueAsString("Value", model);
     CultureInfo culture = ParseLocale != null
                               ? new CultureInfo(GetAsString(ParseLocale, model))
                               : (CultureInfo) model[FormatConstants.LOCALE];
     var format =
         (DateTimeFormatInfo) DateTimeFormatInfo.GetInstance(culture.DateTimeFormat).Clone();
     DateTime? result = null;
     if (!String.IsNullOrEmpty(dateStr))
     {
         if (GetAutoValueAsBool("Exact", model))
         {
             string pattern = GetAsString(Pattern, model) ?? GetPattern(model, format);
             try
             {
                 result = DateTime.ParseExact(dateStr, pattern, format);
             } catch (FormatException)
             {
                 throw TagException.ParseException(dateStr, "Date").Decorate(Context);
             }
         }
         else
         {
             result = DateTime.Parse(dateStr, format);
         }
     }
     return result;
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:29,代码来源:ParseDate.cs


示例7: Evaluate

 public string Evaluate(TagModel model)
 {
     string result = GetAutoValueAsString("Value", model);
     var escapeXml = GetAutoValueAsBool("EscapeXml", model);
     result = result ?? String.Empty;
     return escapeXml ? StringUtils.EscapeXml(result) : result;
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:Out.cs


示例8: ModelTest

 public void ModelTest()
 {
     var model = new TagModel(new Reflection(new Hashtable()));
     model.Model["NewValue"] = "abc";
     Assert.That(model.Model["NewValue"], Is.EqualTo("abc"));
     Assert.That(model[VariableScope.Model + ".NewValue"], Is.EqualTo("abc"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:TagModelTest.cs


示例9: Evaluate

 public string Evaluate(TagModel model)
 {
     string locale = GetAsString(Value, model);
     VariableScope scope = GetAutoValueAs<VariableScope>("Scope", model).Value;
     model[scope + "." + FormatConstants.LOCALE] = new CultureInfo(locale);
     return String.Empty;
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:SetLocale.cs


示例10: InternalEvaluate

 protected override object InternalEvaluate(TagModel model)
 {
     var builder = new StringBuilder();
     builder.Append(GetAsUrl(Value, model) ?? String.Empty);
     builder.Append(ParamsEvaluate(model));
     return builder.ToString();
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:Url.cs


示例11: EvaluateNested

 public XsltParameter EvaluateNested(TagModel model)
 {
     string name = GetAsString(Name, model) ?? String.Empty;
     string nameSpaceUri = GetAsString(NameSpaceUri, model) ?? String.Empty;
     object value = GetAutoValue("Value", model) ?? String.Empty;
     return new XsltParameter(name, nameSpaceUri, value);
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:7,代码来源:Param.cs


示例12: Evaluate

 public static string Evaluate(ITagWithVariable tag, TagModel model)
 {
     object result = tag.InternalEvaluate(model);
     string var = tag.GetAutoValueAsString("Var", model);
     string scope = tag.GetAutoValueAsString("Scope", model);
     model[scope + "." + var] = result;
     return String.Empty;
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:8,代码来源:VariableHelper.cs


示例13: InternalEvaluate

        protected override object InternalEvaluate(TagModel model)
        {
            var urlBuilder = new StringBuilder();
            urlBuilder.Append(GetAsUrl(Url, model));
            urlBuilder.Append(ParamsEvaluate(model));

            return ReadData(PlaceRequest(urlBuilder));
        }
开发者ID:rslijp,项目名称:sharptiles,代码行数:8,代码来源:Import.cs


示例14: GetIEnumerable

        public override IEnumerable GetIEnumerable(TagModel model)
        {
            string items = GetAsString(Items, model) ?? String.Empty;
            string delims = GetAsString(Delims, model);
            string[] tokens = items.Split(delims.ToCharArray());

            return new ArrayList(tokens);
        }
开发者ID:rslijp,项目名称:sharptiles,代码行数:8,代码来源:ForTokens.cs


示例15: CheckParsingOfLocaleDefautScope

 public void CheckParsingOfLocaleDefautScope()
 {
     var model = new TagModel(this);
     var tag = new SetLocale();
     tag.Value = new MockAttribute(new Constant("nl-NL"));
     Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
     Assert.That(model.Page[FormatConstants.LOCALE], Is.EqualTo(new CultureInfo("nl-NL")));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:8,代码来源:SetLocaleTest.cs


示例16: ModelAbovePageResolveTest

 public void ModelAbovePageResolveTest()
 {
     var model = new TagModel(new Reflection(new Hashtable()));
     model.Page["NewValue"] = "Page";
     Assert.That(model["NewValue"], Is.EqualTo("Page"));
     model.Model["NewValue"] = "Model";
     Assert.That(model["NewValue"], Is.EqualTo("Model"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:8,代码来源:TagModelTest.cs


示例17: TestRequestEncodingNoRepsonseSet

 public void TestRequestEncodingNoRepsonseSet()
 {
     var tag = new RequestEncoding();
     tag.Value = new MockAttribute(new Constant("UTF-8"));
     var model = new TagModel(this);
     Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
     Assert.That(model.Encoding, Is.EqualTo(Encoding.UTF8));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:8,代码来源:RequestEncodingTest.cs


示例18: DateAutoValueTestTag_Should_Pass_Date

 public void DateAutoValueTestTag_Should_Pass_Date()
 {
     var _model = new TagModel(new Hashtable() {
         { "SomeDate", new DateTime(1979,10,2)}
     });
     var tag = new DateAutoValueTestTag();
     tag.SomeDateValue = new MockAttribute(new Property("SomeDate"));
     Assert.That(tag.Evaluate(_model), Is.EqualTo("date=02|10|1979"));
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:9,代码来源:AutoValueTest.cs


示例19: GetTagModel

			TagModel GetTagModel (SolutionFolderItem policyParent, Project project, string language, string identifier, string fileName)
			{
				var model = new TagModel();
				var projectModel = ProjectTagModel ?? Outer.ProjectTagModel;
				if (projectModel != null)
					model.InnerModels = new [] { projectModel };
				ModifyTags (policyParent, project, language, identifier, fileName, ref model.OverrideTags);
				return model;
			}
开发者ID:picoe,项目名称:Eto,代码行数:9,代码来源:EnhancedFile.cs


示例20: Evaluate

 public string Evaluate(TagModel model)
 {
     var baseName = GetAsString(BaseName, model);
     var prefix = GetAsString(Prefix, model);
     IResourceBundle bundle = new ResourceBundle(baseName, prefix, BaseName.ResourceLocator);
     model.PushTagStack();
     model.Tag[FormatConstants.BUNDLE] = bundle;
     return GetAsString(Body, model) ?? string.Empty;
 }
开发者ID:rslijp,项目名称:sharptiles,代码行数:9,代码来源:Bundle.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TagNode类代码示例发布时间:2022-05-24
下一篇:
C# TagMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap