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


C# HtmlTag类代码示例

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


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

示例1: Build

 public override HtmlTag Build(ElementRequest request)
 {
     HtmlTag root = new HtmlTag("div").Attr("data-bind", "foreach: "+ CCHtmlConventionsKO.DeriveElementName(request));
     var child = new HtmlTag("div").Attr("data-bind", "text: $data" );
     root.Append(child);
     return root;
 }
开发者ID:reharik,项目名称:CCHtmlHelpers,代码行数:7,代码来源:ListDisplayBuilderKO.cs

示例2: TableTag

 public TableTag()
     : base("table")
 {
     _header = new HtmlTag("thead", this);
     _footer = new HtmlTag("tfoot", this).Render(false);
     _body = new HtmlTag("tbody", this);
 }
开发者ID:reharik,项目名称:CCHtmlHelpers,代码行数:7,代码来源:TableTag.cs

示例3: CssBoxFrame

        /// <summary>
        /// Init.
        /// </summary>
        /// <param name="parent">the parent box of this box</param>
        /// <param name="tag">the html tag data of this box</param>
        public CssBoxFrame(CssBox parent, HtmlTag tag)
            : base(parent, tag)
        {
            _imageWord = new CssRectImage(this);
            Words.Add(_imageWord);

            Uri uri;
            if (Uri.TryCreate(GetAttribute("src"),UriKind.Absolute, out uri))
            {
                if(uri.Host.IndexOf("youtube.com",StringComparison.InvariantCultureIgnoreCase) > -1)
                {
                    _isVideo = true;
                    LoadYoutubeDataAsync(uri);
                }
                else if (uri.Host.IndexOf("vimeo.com",StringComparison.InvariantCultureIgnoreCase) > -1)
                {
                    _isVideo = true;
                    LoadVimeoDataAsync(uri);
                }
            }

            if (!_isVideo)
            {
                SetErrorBorder();
            }
        }
开发者ID:havlenapetr,项目名称:HTMLRenderer,代码行数:31,代码来源:CssBoxFrame.cs

示例4: CustomUIAttribute

 public CustomUIAttribute(int fieldOrder, int fieldLength, HtmlTag tag, string fieldDisplayName)
 {
     _FieldOrder = fieldOrder;
     _FieldLength = fieldLength;
     _Tag = tag;
     _FieldDisplayName = fieldDisplayName;
 }
开发者ID:nicholasceliano,项目名称:.NET-JavaScript-JSON-AJAX-nTier,代码行数:7,代码来源:CustomUIAttribute.cs

示例5: parent_property_is_set_correctly_using_append

 public void parent_property_is_set_correctly_using_append()
 {
     var child = new HtmlTag("span");
     var tag = new HtmlTag("div").Append(child);
     tag.ShouldEqual(child.Parent);
     tag.Children[0].ShouldEqual(child);
 }
开发者ID:calebjenkins,项目名称:htmltags,代码行数:7,代码来源:ParentTagTester.cs

示例6: ApplyTo

        public void ApplyTo(IHtmlNode target)
        {
            var filtered = column.Grid.DataProcessor.FilterDescriptors.SelectRecursive(filter =>
            {
                CompositeFilterDescriptor compositeDescriptor = filter as CompositeFilterDescriptor;

                if (compositeDescriptor != null)
                {
                    return compositeDescriptor.FilterDescriptors;
                }

                return null;
            })
            .Where(filter => filter is FilterDescriptor)
            .OfType<FilterDescriptor>()
            .Any(filter => filter.Member.IsCaseInsensitiveEqual(column.Member));

            var wrapper = new HtmlTag("div")
                .AddClass("t-grid-filter", "t-state-default")
                .ToggleClass("t-active-filter", filtered);

            wrapper.AppendTo(target);

            var icon = new HtmlTag("span").AddClass("t-icon", "t-filter");
            icon.AppendTo(wrapper);
        }
开发者ID:juanplopes,项目名称:simple-telerik,代码行数:26,代码来源:GridFilterAdorner.cs

示例7: Build

 public override void Build(ElementRequest request, HtmlTag tag)
 {
     // todo can we narrow down for numbers that it's a whole number (probably need a regex to allow commas too)
     tag.AllTags()
         .Where(t => t.IsInputElement())
         .ForEach(t => t.AddClass("number"));
 }
开发者ID:phoenixwebgroup,项目名称:DotNetExtensions,代码行数:7,代码来源:NumericValidationModifier.cs

示例8: HtmlListInfo

 public HtmlListInfo(HtmlTag htmlTag, int columns = 0, object htmlAttributes = null, TextLayout textLayout = TextLayout.Default)
 {
     HtmlTag = htmlTag;
     Columns = columns;
     HtmlAttributes = htmlAttributes;
     TextLayout = textLayout;
 }
开发者ID:erashid,项目名称:Extensions,代码行数:7,代码来源:HtmlListInfo.cs

示例9: do_not_write_closing_tag

        public void do_not_write_closing_tag()
        {
            var tag = new HtmlTag("span").Id("id");
            tag.NoClosingTag();

            tag.ToString().ShouldEqual("<span id=\"id\">");
        }
开发者ID:joshuaflanagan,项目名称:fubumvc,代码行数:7,代码来源:HtmlTagTester.cs

示例10: add_returns_the_newly_created_child_tag

 public void add_returns_the_newly_created_child_tag()
 {
     var original = new HtmlTag("div");
     var child = original.Add("span");
     child.ToString().ShouldEqual("<span></span>");
     original.ToString().ShouldEqual("<div><span></span></div>");
 }
开发者ID:ryansroberts,项目名称:htmltags,代码行数:7,代码来源:HtmlTagTester.cs

示例11: append_all_tags_from_a_sequence

 public void append_all_tags_from_a_sequence()
 {
     var sequence = new[] { new HtmlTag("br"), new HtmlTag("hr") };
     var parent = new HtmlTag("div");
     parent.Append(sequence);
     parent.ToString().ShouldEqual("<div><br></br><hr /></div>");
 }
开发者ID:ryansroberts,项目名称:htmltags,代码行数:7,代码来源:HtmlTagTester.cs

示例12: add_and_return_a_child_tag_by_type

 public void add_and_return_a_child_tag_by_type()
 {
     var original = new HtmlTag("div");
     var child = original.Add<HiddenTag>();
     child.ToString().ShouldEqual("<input type=\"hidden\" />");
     original.ToString().ShouldEqual("<div><input type=\"hidden\" /></div>");
 }
开发者ID:ryansroberts,项目名称:htmltags,代码行数:7,代码来源:HtmlTagTester.cs

示例13: AddElementName

 public static void AddElementName(ElementRequest request, HtmlTag tag)
 {
     if (tag.IsInputElement())
     {
         tag.Attr("name", DeriveElementName(request));
     }
 }
开发者ID:reharik,项目名称:CCHtmlHelpers,代码行数:7,代码来源:CCHtmlConventionsKO.cs

示例14: CellTag

        public IHtmlNode CellTag(DateTime day, string urlFormat, bool isOtherMonth)
        {
            IHtmlNode cell = new HtmlTag("td");

            if (isOtherMonth)
            {
                cell.AddClass("t-other-month");
            }
            else if(Calendar.Value != null && day.Day == Calendar.Value.Value.Day)
            {
                cell.AddClass(UIPrimitives.SelectedState);
            }

            if (Calendar.IsDateInRange(day))
            {
                var href = GetUrl(day, urlFormat);

                IHtmlNode link = new HtmlTag("a")
                                 .AddClass(UIPrimitives.Link + (href != "#" ? " t-action-link" : string.Empty))
                                 .Attribute("href", href)
                                 .Text(day.Day.ToString());

                cell.Children.Add(link);
            }
            else
            {
                cell.Html("&nbsp;");
            }

            return cell;
        }
开发者ID:juanplopes,项目名称:simple-telerik,代码行数:31,代码来源:CalendarHtmlBuilder.cs

示例15: is_visible_set_to_true_by_default

        public void is_visible_set_to_true_by_default()
        {
            var tag = new HtmlTag("div");

            tag.Visible().ShouldBeTrue();
            tag.ToString().ShouldEqual("<div></div>");
        }
开发者ID:joshuaflanagan,项目名称:fubumvc,代码行数:7,代码来源:HtmlTagTester.cs


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