NVelocity/App/Events/EventCartridge.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace NVelocity.App.Events
{
using System;
using System.Collections;
using Context;
using Exception;
/// <summary>
/// 'Package' of event handlers...
/// </summary>
public class EventCartridge
{
public event ReferenceInsertionEventHandler ReferenceInsertion;
public event NullSetEventHandler NullSet;
public event MethodExceptionEventHandler MethodExceptionEvent;
/// <summary>
/// Called during Velocity merge before a reference value will
/// be inserted into the output stream.
/// </summary>
/// <param name="referenceStack">the stack of objects used to reach this reference</param>
/// <param name="reference">reference from template about to be inserted</param>
/// <param name="value"> value about to be inserted (after toString() )</param>
/// <returns>
/// Object on which toString() should be called for output.
/// </returns>
internal Object ReferenceInsert(Stack referenceStack, String reference, Object value)
{
if (ReferenceInsertion != null)
{
ReferenceInsertionEventArgs args = new ReferenceInsertionEventArgs(referenceStack, reference, value);
ReferenceInsertion(this, args);
value = args.NewValue;
}
return value;
}
/// <summary>
/// Called during Velocity merge to determine if when
/// a #set() results in a null assignment, a warning
/// is logged.
/// </summary>
/// <returns>true if to be logged, false otherwise</returns>
internal bool ShouldLogOnNullSet(String lhs, String rhs)
{
if (NullSet == null)
return true;
NullSetEventArgs e = new NullSetEventArgs(lhs, rhs);
NullSet(this, e);
return e.ShouldLog;
}
/// <summary>
/// Called during Velocity merge if a reference is null
/// </summary>
/// <param name="claz">Class that is causing the exception</param>
/// <param name="method">method called that causes the exception</param>
后面还有 36 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
