Skip to main content

TemplateExtensions

Assembly: ServiceStack.Razor.dll
View Source
Declaration
public static class TemplateExtensions

Fields

StatementPlaceholderChar

View Source
Declaration
public const char StatementPlaceholderChar = '^'

Methods

SplitOnWhiteSpace(String)

View Source
Declaration
public static string[] SplitOnWhiteSpace(this string text)
Returns

System.String[]

Parameters
TypeName
System.Stringtext

SplitOnWhiteSpaceAndSymbols(String)

View Source
Declaration
public static string[] SplitOnWhiteSpaceAndSymbols(this string text)
Returns

System.String[]

Parameters
TypeName
System.Stringtext

SplitAndTrimOn(String, Char[])

View Source
Declaration
public static string[] SplitAndTrimOn(this string text, char[] chars)
Returns

System.String[]

Parameters
TypeName
System.Stringtext
System.Char[]chars

RenderToMarkdown(MarkdownPage, Dictionary<String, Object>)

View Source
Declaration
public static string RenderToMarkdown(this MarkdownPage markdownPage, Dictionary<string, object> scopeArgs)
Returns

System.String

Parameters
TypeName
ServiceStack.Support.Markdown.MarkdownPagemarkdownPage
System.Collections.Generic.Dictionary<System.String,System.Object>scopeArgs

RenderToHtml(MarkdownPage, Dictionary<String, Object>)

View Source
Declaration
public static string RenderToHtml(this MarkdownPage markdownPage, Dictionary<string, object> scopeArgs)
Returns

System.String

Parameters
TypeName
ServiceStack.Support.Markdown.MarkdownPagemarkdownPage
System.Collections.Generic.Dictionary<System.String,System.Object>scopeArgs

RenderToString(MarkdownPage, Dictionary<String, Object>, Boolean)

View Source
Declaration
public static string RenderToString(this MarkdownPage markdownPage, Dictionary<string, object> scopeArgs, bool renderHtml)
Returns

System.String

Parameters
TypeName
ServiceStack.Support.Markdown.MarkdownPagemarkdownPage
System.Collections.Generic.Dictionary<System.String,System.Object>scopeArgs
System.BooleanrenderHtml

RenderToString(ITemplateWriter, Dictionary<String, Object>)

View Source
Declaration
public static string RenderToString(this ITemplateWriter templateWriter, Dictionary<string, object> scopeArgs)
Returns

System.String

Parameters
TypeName
ServiceStack.Support.Markdown.ITemplateWritertemplateWriter
System.Collections.Generic.Dictionary<System.String,System.Object>scopeArgs

RenderToString(IEnumerable<ITemplateWriter>, Dictionary<String, Object>)

View Source
Declaration
public static string RenderToString(this IEnumerable<ITemplateWriter> templateWriters, Dictionary<string, object> scopeArgs)
Returns

System.String

Parameters
TypeName
System.Collections.Generic.IEnumerable<ServiceStack.Support.Markdown.ITemplateWriter>templateWriters
System.Collections.Generic.Dictionary<System.String,System.Object>scopeArgs

SplitIntoBlocks(String, String)

View Source
Declaration
public static List<TemplateBlock> SplitIntoBlocks(this string content, string onPlaceHolder)
Returns

System.Collections.Generic.List<ServiceStack.Support.Markdown.TemplateBlock>

Parameters
TypeName
System.Stringcontent
System.StringonPlaceHolder

RemoveIfEndingWith(TextBlock, String)

View Source
Declaration
public static void RemoveIfEndingWith(this TextBlock textBlock, string text)
Parameters
TypeName
ServiceStack.Support.Markdown.TextBlocktextBlock
System.Stringtext

TrimIfEndingWith(String, String)

View Source
Declaration
public static string TrimIfEndingWith(this string content, string text)
Returns

System.String

Parameters
TypeName
System.Stringcontent
System.Stringtext

SkipIfNextIs(String, ref Int32, String)

View Source
Declaration
public static void SkipIfNextIs(this string content, ref int pos, string text)
Parameters
TypeName
System.Stringcontent
System.Int32pos
System.Stringtext

TrimLineIfOnlyHasWhitespace(String)

View Source
Declaration
public static string TrimLineIfOnlyHasWhitespace(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

CreateTemplateBlocks(String, List<StatementExprBlock>)

View Source
Declaration
public static List<TemplateBlock> CreateTemplateBlocks(this string content, List<StatementExprBlock> statementBlocks)
Returns

System.Collections.Generic.List<ServiceStack.Support.Markdown.TemplateBlock>

Parameters
TypeName
System.Stringcontent
System.Collections.Generic.List<ServiceStack.Support.Markdown.StatementExprBlock>statementBlocks

GetNextStatementExpr(String, ref Int32)

View Source
Declaration
public static StatementExprBlock GetNextStatementExpr(this string content, ref int fromPos)
Returns

ServiceStack.Support.Markdown.StatementExprBlock

Parameters
TypeName
System.Stringcontent
System.Int32fromPos

PeekAfterWhitespace(String, Int32)

View Source
Declaration
public static char PeekAfterWhitespace(this string content, int index)
Returns

System.Char

Parameters
TypeName
System.Stringcontent
System.Int32index

PeekWordAfterWhitespace(String, Int32)

View Source
Declaration
public static string PeekWordAfterWhitespace(this string content, int index)
Returns

System.String

Parameters
TypeName
System.Stringcontent
System.Int32index

EatWhitespace(String, ref Int32)

View Source
Declaration
public static void EatWhitespace(this string content, ref int index)
Parameters
TypeName
System.Stringcontent
System.Int32index

EatRestOfLine(String, ref Int32)

View Source
Declaration
public static void EatRestOfLine(this string content, ref int index)
Parameters
TypeName
System.Stringcontent
System.Int32index

SafePeekAt(String, Int32)

View Source
Declaration
public static char SafePeekAt(this string content, int fromPos)
Returns

System.Char

Parameters
TypeName
System.Stringcontent
System.Int32fromPos

IsAlphaNumeric(Char)

View Source
Declaration
public static bool IsAlphaNumeric(this char c)
Returns

System.Boolean

Parameters
TypeName
System.Charc

GetNextAlphaNumericExpr(String, ref Int32)

View Source
Declaration
public static string GetNextAlphaNumericExpr(this string content, ref int fromPos)
Returns

System.String

Parameters
TypeName
System.Stringcontent
System.Int32fromPos

GetNextMemberExpr(String, ref Int32)

View Source
Declaration
public static string GetNextMemberExpr(this string content, ref int fromPos)
Returns

System.String

Parameters
TypeName
System.Stringcontent
System.Int32fromPos

RemoveAllWhiteSpace(String)

View Source
Declaration
public static string RemoveAllWhiteSpace(this string content)
Returns

System.String

Parameters
TypeName
System.Stringcontent

GetVarName(String)

View Source
Declaration
public static string GetVarName(this string memberExpr)
Returns

System.String

Parameters
TypeName
System.StringmemberExpr