Skip to content

Commit

Permalink
Multiline C# 6 rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
peterblazejewicz committed Oct 9, 2015
1 parent a5d1a78 commit 420de03
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions TagHelperSamples/TagHelpers/AlertTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,18 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
StringBuilder sb = new StringBuilder();

if (dismissible)
sb.Append(
"<button type =\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\r\n" +
" <span aria-hidden=\"true\">&times;</span>\r\n" +
"</button>\r\n");
sb.Append($@"<button type =""button"" class=""close"" data-dismiss=""alert"" aria-label=""Close"">
<span aria-hidden=""true"">&times;</span>
</button>");

if (string.IsNullOrEmpty(header))
sb.AppendLine($"<i class='fa fa-{icon}'></i> {messageText}");
else
{
sb.Append(
$"<h3><i class='fa fa-{icon}'></i> {headerText}</h3>\r\n" +
"<hr/>\r\n" +
$"{messageText}\r\n");
$@"<h3><i class='fa fa-{icon}'></i> {headerText}</h3>
<hr/>
{messageText}");
}
output.Content.SetContent(sb.ToString());
}
Expand Down

0 comments on commit 420de03

Please sign in to comment.