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

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

renders the value of the string literal If the properties allow, and the string literal contains a $ or a # the literal is rendered against the context Otherwise, the stringlit is returned.
public Value ( IInternalContextAdapter context ) : Object
context IInternalContextAdapter
Результат Object
		public override Object Value(IInternalContextAdapter context)
		{
			string result = image;

			if (IsDictionaryString(result))
			{
				return InterpolateDictionaryString(result, context);
			}
			else
			{
				if (interpolate)
				{
					try
					{
						TextWriter writer = new StringWriter();
						nodeTree.Render(context, writer);

						/*
						 * and return the result as a String
						 */

						String ret = writer.ToString();

						/*
						 *  remove the space from the end (dreaded <MORE> kludge)
						 */

						result = ret.Substring(0, (ret.Length - 1) - (0));
					}
					catch(Exception e)
					{
						rsvc.Error("Error in interpolating string literal : " + e);
						result = image;
					}
				}

				return result;
			}
		}