CSharpUtils.Templates.ParserNodes.ParserNodeContext.Indent C# (CSharp) Метод

Indent() публичный Метод

public Indent ( System.Action Action ) : void
Action System.Action
Результат void
		public void Indent(Action Action)
		{
			IndentationLevel++;
			try
			{
				Action();
			}
			finally
			{
				IndentationLevel--;
			}
		}

Usage Example

Пример #1
0
        override public void WriteTo(ParserNodeContext Context)
        {
            //DynamicUtils.CountArray

            //Foreach(TemplateContext Context, String VarName, dynamic Expression, Action Iteration, Action Else = null)

            Context.WriteLine("Context.NewScope(delegate() {");
            Context.Indent(delegate()
            {
                Context.Write("Foreach(Context, {0}, ", StringUtils.EscapeString(VarName));
                Context.Indent(delegate()
                {
                    LoopIterator.WriteTo(Context);
                });
                Context.Write(", ");
                Context.WriteLine("new EmptyDelegate(delegate() {");
                Context.Indent(delegate()
                {
                    BodyBlock.WriteTo(Context);
                });
                Context.Write("})");
                if (!(ElseBlock is DummyParserNode))
                {
                    Context.Write(", ");
                    Context.WriteLine("new EmptyDelegate(delegate() {");
                    ElseBlock.WriteTo(Context);
                    Context.Write("})");
                }
                Context.WriteLine(");");          // Foreach
            });
            Context.WriteLine("});");             // Context.NewScope
        }
All Usage Examples Of CSharpUtils.Templates.ParserNodes.ParserNodeContext::Indent