2013-01-10 02:17:45 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace mustache
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines a tag that renders its content if all preceding if and elif tags.
|
|
|
|
|
/// </summary>
|
2013-01-12 19:53:12 +00:00
|
|
|
|
internal sealed class ElseTagDefinition : ContentTagDefinition
|
2013-01-10 02:17:45 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of a ElseTagDefinition.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ElseTagDefinition()
|
|
|
|
|
: base("else", true)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-01-12 19:53:12 +00:00
|
|
|
|
/// Gets whether the tag only exists within the scope of its parent.
|
2013-01-10 02:17:45 +00:00
|
|
|
|
/// </summary>
|
2013-01-12 19:53:12 +00:00
|
|
|
|
protected override bool GetIsContextSensitive()
|
2013-01-10 02:17:45 +00:00
|
|
|
|
{
|
2013-01-12 19:53:12 +00:00
|
|
|
|
return true;
|
2013-01-10 02:17:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the tags that indicate the end of the current tag's content.
|
|
|
|
|
/// </summary>
|
2013-01-12 19:53:12 +00:00
|
|
|
|
protected override IEnumerable<string> GetClosingTags()
|
2013-01-10 02:17:45 +00:00
|
|
|
|
{
|
2013-01-12 19:53:12 +00:00
|
|
|
|
return new string[] { "if" };
|
2013-01-10 02:17:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|