NVelocity.Runtime.Parser.Node.ASTStringLiteral.Evaluate C# (CSharp) Метод

Evaluate() приватный Метод

private Evaluate ( NVelocity.Runtime.Parser.Node.SimpleNode inlineNode, IInternalContextAdapter context ) : object
inlineNode NVelocity.Runtime.Parser.Node.SimpleNode
context IInternalContextAdapter
Результат object
		private object Evaluate(SimpleNode inlineNode, IInternalContextAdapter context)
		{
			if (inlineNode.ChildrenCount == 1)
			{
				INode child = inlineNode.GetChild(0);
				return child.Value(context);
			}
			else
			{
				StringBuilder result = new StringBuilder();

				for(int i = 0; i < inlineNode.ChildrenCount; i++)
				{
					INode child = inlineNode.GetChild(i);

					if (child.Type == ParserTreeConstants.REFERENCE)
					{
						result.Append(child.Value(context));
					}
					else
					{
						result.Append(child.Literal);
					}
				}

				return result.ToString();
			}
		}