/// <summary> /// Adds a new <see cref="ElseExpressionScopeDocumentItem"/> and enters it. /// </summary> public static MorestachioDocumentFluentApi AddElseAndEnter(this MorestachioDocumentFluentApi api) { return(api .AddChildAndEnter(builder => new ElseExpressionScopeDocumentItem())); }
/// <summary> /// Adds a new <see cref="ElseExpressionScopeDocumentItem"/> and enters it. /// </summary> public static MorestachioDocumentFluentApi AddGlobalVariable(this MorestachioDocumentFluentApi api, string name, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition) { return(api.AddChild(builder => new EvaluateVariableDocumentItem(name, condition(builder).Compile()))); }
/// <summary> /// Adds a new <see cref="ContentDocumentItem"/>. /// </summary> public static MorestachioDocumentFluentApi AddContent(this MorestachioDocumentFluentApi api, string content) { return(api.AddChild(f => new ContentDocumentItem(content))); }
/// <summary> /// Adds a new <see cref="EachDocumentItem"/> and enters it. /// </summary> public static MorestachioDocumentFluentApi AddEachLoopAndEnter(this MorestachioDocumentFluentApi api, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition) { return(api.AddChildAndEnter(builder => new EachDocumentItem(condition(builder).Compile()))); }
/// <summary> /// Adds a new <see cref="RenderPartialDocumentItem"/> /// </summary> public static MorestachioDocumentFluentApi AddInclude(this MorestachioDocumentFluentApi api, string name, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition = null) { return(api.AddChild(builder => new RenderPartialDocumentItem(name, condition?.Invoke(builder).Compile()))); }
/// <summary> /// Adds a new <see cref="TextEditDocumentItem"/> /// </summary> public static MorestachioDocumentFluentApi AddTextModification(this MorestachioDocumentFluentApi api, ITextOperation textOperation) { return(api.AddChild(builder => new TextEditDocumentItem(textOperation))); }
/// <summary> /// Adds a new <see cref="InvertedExpressionScopeDocumentItem"/> and enters it. /// </summary> public static MorestachioDocumentFluentApi AddInvertedScopeAndEnter(this MorestachioDocumentFluentApi api, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition) { return(api.AddChildAndEnter(builder => new InvertedExpressionScopeDocumentItem(CharacterLocation.Unknown, condition(builder).Compile(), Enumerable.Empty <ITokenOption>()))); }
/// <summary> /// Adds a new <see cref="PathDocumentItem"/> /// </summary> public static MorestachioDocumentFluentApi AddPath(this MorestachioDocumentFluentApi api, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition, bool escapeValue = false) { return(api.AddChild(builder => new PathDocumentItem(condition(builder).Compile(), escapeValue))); }
/// <summary> /// Adds a new <see cref="ElseExpressionScopeDocumentItem"/> and enters it. /// </summary> public static MorestachioDocumentFluentApi AddGlobalVariable(this MorestachioDocumentFluentApi api, string name, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition) { return(api.AddChild(builder => new EvaluateVariableDocumentItem(CharacterLocation.Unknown, name, condition(builder).Compile(), Enumerable.Empty <ITokenOption>()))); }
/// <summary> /// Adds a new <see cref="ContentDocumentItem"/>. /// </summary> public static MorestachioDocumentFluentApi AddContent(this MorestachioDocumentFluentApi api, string content) { return(api.AddChild(f => new ContentDocumentItem(CharacterLocation.Unknown, content, Enumerable.Empty <ITokenOption>()))); }
/// <summary> /// Adds a new <see cref="TextEditDocumentItem"/> /// </summary> public static MorestachioDocumentFluentApi AddTextModification(this MorestachioDocumentFluentApi api, ITextOperation textOperation) { return(api.AddChild(builder => new TextEditDocumentItem(CharacterLocation.Unknown, textOperation, EmbeddedInstructionOrigin.Self, Enumerable.Empty <ITokenOption>()))); }
/// <summary> /// Adds a new <see cref="RenderPartialDocumentItem"/> /// </summary> public static MorestachioDocumentFluentApi AddInclude(this MorestachioDocumentFluentApi api, string name, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition = null) { return(api.AddChild(builder => new RenderPartialDocumentItem(CharacterLocation.Unknown, name, condition?.Invoke(builder).Compile(), Enumerable.Empty <ITokenOption>()))); }
/// <summary> /// Adds a new <see cref="PathDocumentItem"/> /// </summary> public static MorestachioDocumentFluentApi AddPath(this MorestachioDocumentFluentApi api, Func <MorestachioExpressionBuilderBaseRootApi, MorestachioExpressionBuilder> condition, bool escapeValue = true) { return(api.AddChild(builder => new PathDocumentItem(CharacterLocation.Unknown, condition(builder).Compile(), escapeValue, Enumerable.Empty <ITokenOption>()))); }