2013-04-25 01:21:00 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2013-05-03 12:44:51 +00:00
|
|
|
|
namespace Mustache
|
2013-04-25 01:21:00 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines a tag that renders its content if all preceding if and elif tags.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal sealed class ElseTagDefinition : ContentTagDefinition
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of a ElseTagDefinition.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ElseTagDefinition()
|
|
|
|
|
: base("else", true)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets whether the tag only exists within the scope of its parent.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected override bool GetIsContextSensitive()
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the tags that indicate the end of the current tag's content.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected override IEnumerable<string> GetClosingTags()
|
|
|
|
|
{
|
2014-02-04 13:07:28 +00:00
|
|
|
|
return new string[] { "if","eq","gt","gte","lt","lte" };
|
2013-04-25 01:21:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-04-25 12:46:03 +00:00
|
|
|
|
/// Gets the parameters that are used to create a new child context.
|
2013-04-25 01:21:00 +00:00
|
|
|
|
/// </summary>
|
2013-04-25 12:46:03 +00:00
|
|
|
|
/// <returns>The parameters that are used to create a new child context.</returns>
|
|
|
|
|
public override IEnumerable<TagParameter> GetChildContextParameters()
|
2013-04-25 01:21:00 +00:00
|
|
|
|
{
|
2013-04-25 12:46:03 +00:00
|
|
|
|
return new TagParameter[0];
|
2013-04-25 01:21:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|