2013-05-03 12:44:51 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
|
|
namespace Mustache
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generates a static block of text.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal sealed class StaticGenerator : IGenerator
|
|
|
|
|
{
|
2013-07-23 12:44:48 +00:00
|
|
|
|
private readonly string value;
|
2013-05-03 12:44:51 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-07-23 12:44:48 +00:00
|
|
|
|
/// Initializes a new instance of a StaticGenerator.
|
2013-05-03 12:44:51 +00:00
|
|
|
|
/// </summary>
|
2013-07-23 12:44:48 +00:00
|
|
|
|
public StaticGenerator(string value)
|
2013-05-03 12:44:51 +00:00
|
|
|
|
{
|
2013-07-23 12:44:48 +00:00
|
|
|
|
this.value = value.Replace(Environment.NewLine, String.Empty);
|
2013-05-03 12:44:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the static text.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Value
|
|
|
|
|
{
|
2013-07-23 12:44:48 +00:00
|
|
|
|
get { return value; }
|
2013-05-03 12:44:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-07-20 16:06:38 +00:00
|
|
|
|
void IGenerator.GetText(KeyScope scope, TextWriter writer, object contextData)
|
2013-05-03 12:44:51 +00:00
|
|
|
|
{
|
|
|
|
|
writer.Write(Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|