public override object VisitEventDeclaration (ICSharpCode.NRefactory.Ast.EventDeclaration eventDeclaration, object data) { DomEvent evt = new DomEvent (); evt.Name = eventDeclaration.Name; evt.Documentation = RetrieveDocumentation (eventDeclaration.StartLocation.Line); evt.Location = ConvertLocation (eventDeclaration.StartLocation); evt.Modifiers = ConvertModifiers (eventDeclaration.Modifier); evt.ReturnType = ConvertReturnType (eventDeclaration.TypeReference); evt.BodyRegion = ConvertRegion (eventDeclaration.BodyStart, eventDeclaration.BodyEnd); if (eventDeclaration.AddRegion != null && !eventDeclaration.AddRegion.IsNull) { DomMethod addMethod = new DomMethod (); addMethod.Name = "add"; addMethod.BodyRegion = ConvertRegion (eventDeclaration.AddRegion.StartLocation, eventDeclaration.AddRegion.EndLocation); evt.AddMethod = addMethod; } if (eventDeclaration.RemoveRegion != null && !eventDeclaration.RemoveRegion.IsNull) { DomMethod removeMethod = new DomMethod (); removeMethod.Name = "remove"; removeMethod.BodyRegion = ConvertRegion (eventDeclaration.RemoveRegion.StartLocation, eventDeclaration.RemoveRegion.EndLocation); evt.RemoveMethod = removeMethod; } AddAttributes (evt, eventDeclaration.Attributes); AddExplicitInterfaces (evt, eventDeclaration.InterfaceImplementations); evt.DeclaringType = typeStack.Peek (); typeStack.Peek ().Add (evt); return null; }
public override object VisitEventDeclaration(ICSharpCode.NRefactory.Ast.EventDeclaration eventDeclaration, object data) { Debug.Assert(currentType.Count > 0); DomType type = currentType.Peek(); type.Add(new DomEvent(eventDeclaration.Name, (Modifiers)eventDeclaration.Modifier, new DomLocation(eventDeclaration.StartLocation.Line, eventDeclaration.StartLocation.Column), TranslateTypeReference(eventDeclaration.TypeReference))); return(null); }