本文整理汇总了C#中IHtmlNode.Attribute方法的典型用法代码示例。如果您正苦于以下问题:C# IHtmlNode.Attribute方法的具体用法?C# IHtmlNode.Attribute怎么用?C# IHtmlNode.Attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHtmlNode
的用法示例。
在下文中一共展示了IHtmlNode.Attribute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decorate
public void Decorate(IHtmlNode td)
{
if (rowSpan > 1)
{
td.Attribute("rowSpan", rowSpan.ToString());
}
if (dataIndex > -1)
{
td.Attribute("data-index", dataIndex.ToString(), true);
}
}
示例2: AddEventAttributes
protected virtual void AddEventAttributes(IHtmlNode html, IDictionary<string, object> events)
{
foreach (var keyValuePair in events)
{
var value = keyValuePair.Value as ClientHandlerDescriptor;
var key = "data-" + keyValuePair.Key;
if (value.HandlerName.HasValue())
{
html.Attribute(key, value.HandlerName);
}
}
}
示例3: AddAttributes
protected virtual void AddAttributes(IHtmlNode link)
{
if (Url.HasValue())
{
link.Attribute("href", Url);
}
if (Target.HasValue())
{
link.Attribute("data-target", Target);
}
if (Rel != MobileButtonRel.None)
{
link.Attribute("data-rel", Rel.ToString().ToLower());
if (Rel == MobileButtonRel.ActionSheet)
{
link.Attribute("data-actionsheet-context", ActionsheetContext);
}
}
link.Attributes(LinkHtmlAttributes);
}
示例4: ApplyButtonAttributes
protected override void ApplyButtonAttributes(IHtmlNode button, object dataItem)
{
button.Attribute("href", Url(dataItem));
}
示例5: ApplyButtonAttributes
protected override void ApplyButtonAttributes(IHtmlNode button, object dataItem)
{
button.Attribute("type", "submit");
}
示例6: SerializeViews
private void SerializeViews(IHtmlNode html)
{
if (component.Views.Length == 0)
return;
var output = new StringBuilder();
output.Append("[");
foreach (var view in component.Views)
{
output.Append("\"");
output.Append(HttpUtility.HtmlAttributeEncode(view));
output.Append("\",");
}
output.Remove(output.Length - 1, 1);
output.Append("]");
html.Attribute("data-views", output.ToString());
}