public override string ToString() { var fullUrl = UrlContext.Combine(_baseUrl, _imageSrcUrl).ToFullUrl(); var html = @"<img src=""{0}""{1}/>".ToFormat(fullUrl, GetHtmlAttributesString()); return(html); }
public override string ToString() { if (_baseUrl.IsNotEmpty()) { _href = UrlContext.Combine(_baseUrl, _href); } this.Attr("href", _href.ToFullUrl()); return(@"<link{0}/>".ToFormat(GetHtmlAttributesString())); }
public override string ToString() { var nonEmptyPaths = _scriptRelPaths.Where(path => path.IsNotEmpty()); if (nonEmptyPaths.Count() == 0) { return(string.Empty); } var scriptFormat = @"<script type=""text/javascript"" src=""{0}""></script>"; var html = new StringBuilder(); nonEmptyPaths.Where(path => path.IsNotEmpty()).Each(path => { var fullUrl = UrlContext.Combine(_baseUrl, path).ToFullUrl(); html.AppendFormat("{0}\r\n{1}", scriptFormat.ToFormat(fullUrl), HttpUtility.HtmlDecode(_indentation)); }); return(html.Length <= (2 + _indentation.Length) ? String.Empty : html.ToString(0, html.Length - (2 + _indentation.Length))); }