private EventElement ParseEvent(
CodeAccess access, MemberModifiers memberAttributes, bool isCustom)
{
EventElement eventElement = new EventElement();
string name = CaptureWord();
eventElement.Name = name;
eventElement.Access = access;
eventElement.MemberModifiers = memberAttributes;
EatWhiteSpace(WhiteSpaceTypes.SpaceAndTab);
if (NextChar == VBSymbol.BeginParameterList)
{
eventElement.Parameters = ParseNestedText(
VBSymbol.BeginParameterList, VBSymbol.EndParameterList, true, true);
}
else
{
EatWord(VBKeyword.As);
string eventType = CaptureTypeName();
if (string.IsNullOrEmpty(eventType))
{
this.OnParseError("Expected type identifier");
}
eventElement.Type = eventType;
}
string[] implements;
string blockTemp = TryParseImplements(out implements);
foreach (string implementation in implements)
{
InterfaceReference interfaceReference =
new InterfaceReference(implementation, InterfaceReferenceType.Interface);
eventElement.AddImplementation(interfaceReference);
}
if (isCustom)
{
eventElement.BodyText = (blockTemp + this.ParseBlock(VBKeyword.Event)).Trim();
}
return eventElement;
}