Changed return type of @Library.If to IHtmlString so that you can return HTML with it

This commit is contained in:
agrath@gmail.com
2011-07-02 17:27:27 -12:00
parent 8435067e98
commit 49a0c8a11a

View File

@@ -162,13 +162,13 @@ namespace umbraco.MacroEngines.Library
return string.Join(seperator, results);
}
public string If(bool test, string valueIfTrue, string valueIfFalse)
public HtmlString If(bool test, string valueIfTrue, string valueIfFalse)
{
return test ? valueIfTrue : valueIfFalse;
return test ? new HtmlString(valueIfTrue) : new HtmlString(valueIfFalse);
}
public string If(bool test, string valueIfTrue)
public HtmlString If(bool test, string valueIfTrue)
{
return test ? valueIfTrue : string.Empty;
return test ? new HtmlString(valueIfTrue) : new HtmlString(string.Empty);
}
public HtmlTagWrapper Wrap(string tag, string innerText, params HtmlTagWrapperBase[] Children)