예제 #1
0
        public bool CheckEvent(ICS.CustomEventDeclaration node, InspectionData data)
        {
            if ((MatchKind != 0 && (MatchKind & DeclarationKinds.Event) == 0) || !CheckAttributedNode(node, ICS.Modifiers.Private))
            {
                return(false);
            }

            var name = node.Name;

            if (IsValid(name))
            {
                return(true);
            }

            data.Add(GetFixableResult(node.NameToken.StartLocation, null, name));
            return(true);
        }
예제 #2
0
        public override IEntity VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration, object data)
        {
            DefaultEvent e = new DefaultEvent(currentTypeDefinition, eventDeclaration.Name);

            e.Region     = MakeRegion(eventDeclaration);
            e.BodyRegion = MakeBraceRegion(eventDeclaration);
            ApplyModifiers(e, eventDeclaration.Modifiers);
            e.ReturnType = ConvertType(eventDeclaration.ReturnType);
            ConvertAttributes(e.Attributes, eventDeclaration.Attributes);

            if (!eventDeclaration.PrivateImplementationType.IsNull)
            {
                e.Accessibility = Accessibility.None;
                e.InterfaceImplementations.Add(ConvertInterfaceImplementation(eventDeclaration.PrivateImplementationType, e.Name));
            }

            e.AddAccessor    = ConvertAccessor(eventDeclaration.AddAccessor, e.Accessibility);
            e.RemoveAccessor = ConvertAccessor(eventDeclaration.RemoveAccessor, e.Accessibility);

            currentTypeDefinition.Events.Add(e);
            return(e);
        }
예제 #3
0
 void IAstVisitor.VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration)
 {
     Visit(EnterCustomEventDeclaration, LeaveCustomEventDeclaration, eventDeclaration);
 }
예제 #4
0
 public virtual S VisitCustomEventDeclaration(CustomEventDeclaration eventDeclaration, T data)
 {
     return(VisitChildren(eventDeclaration, data));
 }
 public virtual S VisitCustomEventDeclaration(CustomEventDeclaration customEventDeclaration, T data)
 {
     throw new NotImplementedException();
 }