50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace AspClassic.Parser;
|
|
|
|
/// <summary>
|
|
/// A parse tree for a RaiseEvent statement.
|
|
/// </summary>
|
|
public sealed class RaiseEventStatement : Statement
|
|
{
|
|
private readonly SimpleName _Name;
|
|
|
|
private readonly ArgumentCollection _Arguments;
|
|
|
|
/// <summary>
|
|
/// The name of the event to raise.
|
|
/// </summary>
|
|
public SimpleName Name => _Name;
|
|
|
|
/// <summary>
|
|
/// The arguments to the event.
|
|
/// </summary>
|
|
public ArgumentCollection Arguments => _Arguments;
|
|
|
|
/// <summary>
|
|
/// Constructs a new parse tree for a RaiseEvents statement.
|
|
/// </summary>
|
|
/// <param name="name">The name of the event to raise.</param>
|
|
/// <param name="arguments">The arguments to the event.</param>
|
|
/// <param name="span">The location of the parse tree.</param>
|
|
/// <param name="comments">The comments for the parse tree.</param>
|
|
public RaiseEventStatement(SimpleName name, ArgumentCollection arguments, Span span, IList<Comment> comments)
|
|
: base(TreeType.RaiseEventStatement, span, comments)
|
|
{
|
|
if (name == null)
|
|
{
|
|
throw new ArgumentNullException("name");
|
|
}
|
|
SetParent(name);
|
|
SetParent(arguments);
|
|
_Name = name;
|
|
_Arguments = arguments;
|
|
}
|
|
|
|
protected override void GetChildTrees(IList<Tree> childList)
|
|
{
|
|
Tree.AddChild(childList, Name);
|
|
Tree.AddChild(childList, Arguments);
|
|
}
|
|
}
|