using System.Collections.Generic;
namespace AspClassic.Parser;
///
/// A parse tree for a RaiseEvent property accessor.
///
public sealed class RaiseEventAccessorDeclaration : ModifiedDeclaration
{
private readonly Location _RaiseEventLocation;
private readonly ParameterCollection _Parameters;
private readonly StatementCollection _Statements;
private readonly EndBlockDeclaration _EndStatement;
///
/// The location of the 'RaiseEvent'.
///
public Location RaiseEventLocation => _RaiseEventLocation;
///
/// The accessor's parameters.
///
public ParameterCollection Parameters => _Parameters;
///
/// The statements in the accessor.
///
public StatementCollection Statements => _Statements;
///
/// The End declaration for the accessor.
///
public EndBlockDeclaration EndStatement => _EndStatement;
///
/// Constructs a new parse tree for a property accessor.
///
/// The attributes for the parse tree.
/// The location of the 'RaiseEvent'.
/// The parameters of the declaration.
/// The statements in the declaration.
/// The end block declaration, if any.
/// The location of the parse tree.
/// The comments for the parse tree.
public RaiseEventAccessorDeclaration(AttributeBlockCollection attributes, Location raiseEventLocation, ParameterCollection parameters, StatementCollection statements, EndBlockDeclaration endStatement, Span span, IList comments)
: base(TreeType.RaiseEventAccessorDeclaration, attributes, null, span, comments)
{
SetParent(parameters);
SetParent(statements);
SetParent(endStatement);
_Parameters = parameters;
_RaiseEventLocation = raiseEventLocation;
_Statements = statements;
_EndStatement = endStatement;
}
protected override void GetChildTrees(IList childList)
{
base.GetChildTrees(childList);
Tree.AddChild(childList, Parameters);
Tree.AddChild(childList, Statements);
Tree.AddChild(childList, EndStatement);
}
}