本文整理汇总了C#中HtmlTags.HtmlTag.Add方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTag.Add方法的具体用法?C# HtmlTag.Add怎么用?C# HtmlTag.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlTags.HtmlTag
的用法示例。
在下文中一共展示了HtmlTag.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisualizeException
public HtmlTag VisualizeException(ExceptionReport report)
{
var tag = new HtmlTag("div");
tag.Add("p").Add("b").Text("Exception: " + report.ExceptionType);
tag.Add("pre").AddClass("text-warning").Text(report.ExceptionText);
return tag;
}
示例2: GetCharisma_Alert
public static string GetCharisma_Alert(Charisma_AlertType type, string title, string msg)
{
var tag = new HtmlTag("div").AddClass("alert").AddClass(type.ToText());
tag.Add("button").AddClass("close").Attr("type", "button").Attr("data-dismiss", "alert").Text("×");
tag.Add("h4").AddClass("alert-heading").Text(title);
tag.Add("p").Text(msg);
return tag.ToString();
}
示例3: HtmlDocument
public HtmlDocument()
{
RootTag = new HtmlTag("html");
DocType = "<!DOCTYPE html>";
_head = RootTag.Add("head");
_title = _head.Add("title");
_body = RootTag.Add("body");
Last = _body;
}
示例4: get_scheduled_jobs
public HtmlTag get_scheduled_jobs()
{
var tag = new HtmlTag("div");
tag.Add("h1").Text("Scheduled Jobs Monitor");
tag.Add("p").Text("at {0} -- reload the page to refresh the data".ToFormat(DateTime.Now));
var schedule = _persistence.FindAll(_graph.Name);
tag.Append(new ScheduledJobTable(_urls, schedule));
return tag;
}
示例5: find_first_child
public void find_first_child()
{
var tag = new HtmlTag("a");
tag.Add("span");
tag.Add("span");
var div = tag.Add("div");
tag.Add("input");
tag.Add("button");
new TagHolder(tag).ForChild("div").ShouldBeTheSameAs(div);
}
示例6: Transform
public string Transform(Topic current, string data)
{
var ol = new HtmlTag("ol").AddClass("breadcrumb");
current.Ancestors().Each(x =>
{
ol.Add("li/a").Attr("href", _resolver.ToUrl(current, x)).Text(x.Title);
});
ol.Add("li").AddClass("active").Text(current.Title);
return ol.ToString();
}
示例7: BuildFolderTag
public HtmlTag BuildFolderTag(SpecificationFolder folder)
{
var folderTag = new HtmlTag("li");
var link = linkTagForFolder(folder);
folderTag.Add("span").AddClass("folder").Append(link);
var ul = folderTag.Add("ul");
var builder = new ChildTagBuilder(this, ul);
folder.ImmediateChildren.Each(x => x.AcceptVisitor(builder));
return folderTag;
}
示例8: get_subscriptions
public HtmlTag get_subscriptions()
{
var div = new HtmlTag("div");
div.Add("h3").Text("Subscription Persistence");
div.Append( new DescriptionBodyTag(Description.For(_persistence)));
div.Add("h3").Text("Nodes");
div.Append(new TransportNodeTableTag(_persistence.AllNodes()));
div.Add("h3").Text("Subscriptions");
div.Append(new SubscriptionStorageTableTag(_persistence.AllSubscriptions()));
return div;
}
示例9: get_conventions
public ConventionsViewModel get_conventions()
{
var configTypes = new string[]
{
ConfigurationType.Settings,
ConfigurationType.Discovery,
ConfigurationType.Explicit,
ConfigurationType.Policy,
ConfigurationType.Attributes,
ConfigurationType.ModifyRoutes,
ConfigurationType.InjectNodes,
ConfigurationType.Conneg,
ConfigurationType.Attachment,
ConfigurationType.Navigation,
ConfigurationType.ByNavigation,
ConfigurationType.Reordering,
ConfigurationType.Instrumentation
};
var tag = new HtmlTag("ul");
configTypes.Each(configType => {
tag.Add("li/a").Text(configType).Attr("href", "#" + configType);
});
return new ConventionsViewModel
{
Descriptions = new TagList(configTypes.Select(configType => new ConfigurationTypeTag(configType, _graph))),
TableOfContents = tag
};
}
示例10: get_tasks
public HtmlTag get_tasks()
{
var peers = _repository.FindPeers();
var cache = new Cache<Uri, TransportNode>();
peers.Each(peer => peer.OwnedTasks.Each(x => cache[x] = peer));
var tag = new HtmlTag("div");
tag.Add("h1").Text("Task Assignements");
var table = new TableTag();
tag.Append(table);
table.AddClass("table");
table.AddHeaderRow(row => {
row.Header("Task");
row.Header("Assigned to");
row.Header("Control Channel");
});
var tasks = _tasks.PermanentTasks().Union(_tasks.ActiveTasks()).ToArray();
tasks.Each(uri => {
table.AddBodyRow(row => addRow(row, uri, cache));
});
return tag;
}
示例11: HtmlDocument
public HtmlDocument()
{
_head = _top.Add("head");
_title = _head.Add("title");
_body = _top.Add("body");
_last = _body;
}
示例12: VisualizePartial
public HtmlTag VisualizePartial(BehaviorFinish finish)
{
var description = Description.For(finish.Correlation.Node);
var tag = new HtmlTag("div").AddClass("behavior-finish");
tag.Add("span").Text("Finished ").Add("i").Text(description.Title);
if (!finish.Succeeded)
{
tag.Next = new ExceptionReportTag(finish.Exception);
tag.Add("span").Text(finish.Exception.ExceptionType).AddClass("exception");
}
tag.PrependGlyph("icon-chevron-up");
return tag;
}
示例13: HtmlDocument
public HtmlDocument()
{
DocType =
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
_head = _top.Add("head");
_title = _head.Add("title");
_body = _top.Add("body");
_last = _body;
}
示例14: HtmlPartial
public HtmlTag HtmlPartial(PartialRequest request)
{
var inner = new HtmlTag("div");
for (var i = 0; i < 5; i++)
{
inner.Add("p").Text(Guid.NewGuid().ToString());
}
return inner;
}
示例15: get_description_Name
public HtmlTag get_description_Name(DescriptionRequest request)
{
var description = DescriptionBag.DescriptionFor(request.Name);
var tag = new HtmlTag("div");
tag.Add("h4").Text(description.Title);
tag.Append(new DescriptionBodyTag(description));
return tag;
}