2013-10-30 19:39:38 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Mustache.Properties;
|
|
|
|
|
|
|
|
|
|
namespace Mustache
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Holds the information descibing a variable that is found in a template.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class VariableFoundEventArgs : EventArgs
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes a new instance of a VariableFoundEventArgs.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="key">The key that was found.</param>
|
|
|
|
|
/// <param name="alignment">The alignment that will be applied to the substitute value.</param>
|
|
|
|
|
/// <param name="formatting">The formatting that will be applied to the substitute value.</param>
|
2016-03-21 17:41:46 +00:00
|
|
|
|
/// <param name="isExtension">Specifies whether the variable was found within triple curly braces.</param>
|
2013-10-30 19:39:38 +00:00
|
|
|
|
/// <param name="context">The context where the placeholder was found.</param>
|
2016-03-21 17:41:46 +00:00
|
|
|
|
internal VariableFoundEventArgs(string name, string alignment, string formatting, bool isExtension, Context[] context)
|
2013-10-30 19:39:38 +00:00
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Alignment = alignment;
|
|
|
|
|
Formatting = formatting;
|
2016-03-21 17:41:46 +00:00
|
|
|
|
IsExtension = isExtension;
|
2013-10-30 19:39:38 +00:00
|
|
|
|
Context = context;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the key that was found.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the alignment that will be applied to the substitute value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Alignment { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the formatting that will be applied to the substitute value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Formatting { get; set; }
|
|
|
|
|
|
2016-03-21 17:41:46 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets whether variable was found within triple curly braces.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsExtension { get; set; }
|
|
|
|
|
|
2013-10-30 19:39:38 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the context where the placeholder was found.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public Context[] Context { get; private set; }
|
|
|
|
|
}
|
|
|
|
|
}
|