2013-04-18 23:26:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
2013-05-03 12:44:51 +00:00
|
|
|
|
namespace Mustache
|
2013-04-18 23:26:58 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Holds the information needed to handle a missing key.
|
|
|
|
|
/// </summary>
|
2013-04-25 01:21:00 +00:00
|
|
|
|
public class KeyNotFoundEventArgs : EventArgs
|
2013-04-18 23:26:58 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2013-04-25 01:21:00 +00:00
|
|
|
|
/// Initializes a new instance of a KeyNotFoundEventArgs.
|
2013-04-18 23:26:58 +00:00
|
|
|
|
/// </summary>
|
2013-04-19 12:56:21 +00:00
|
|
|
|
/// <param name="key">The fully-qualified key.</param>
|
|
|
|
|
/// <param name="missingMember">The part of the key that could not be found.</param>
|
2016-03-21 17:41:46 +00:00
|
|
|
|
/// <param name="isExtension">Specifies whether the key appears within triple curly braces.</param>
|
|
|
|
|
internal KeyNotFoundEventArgs(string key, string missingMember, bool isExtension)
|
2013-04-18 23:26:58 +00:00
|
|
|
|
{
|
2013-04-19 12:56:21 +00:00
|
|
|
|
Key = key;
|
|
|
|
|
MissingMember = missingMember;
|
2016-03-21 17:41:46 +00:00
|
|
|
|
IsExtension = isExtension;
|
2013-04-18 23:26:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-04-19 12:56:21 +00:00
|
|
|
|
/// Gets the fully-qualified key.
|
2013-04-18 23:26:58 +00:00
|
|
|
|
/// </summary>
|
2013-04-19 12:56:21 +00:00
|
|
|
|
public string Key { get; private set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the part of the key that could not be found.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string MissingMember { get; private set; }
|
2013-04-18 23:26:58 +00:00
|
|
|
|
|
2016-03-21 17:41:46 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets whether the key appeared within triple curly braces.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsExtension { get; private set; }
|
|
|
|
|
|
2013-04-18 23:26:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets whether to use the substitute.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool Handled { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets the object to use as the substitute.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public object Substitute { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|