EventRaise
The EventRaise aspect can be applied to events to force a "raise" accessor to be generated, which can be used to call the underlying event from the outside of the class. It takes an optional Visibility parameter, if omitted it will use the same visibility as the event itself. The aspect's behavior matches the raise syntax for Oxygene events.
type
BaseClass = public class
public
[EventRaise(Visibility.Protected)]
event MyEvent: Action; // uses Aspect
event MyEvent2: Action protected raise; // uses Oxygene-specific "raise" syntax
end;
SubClass = public class(BaseClass)
public
method CallMyEvent();
begin
MyEvent();
MyEvent2();
end;
end;
public class BaseClass
{
[EventRaise(Visibility.Protected)]
public event Action MyEvent;
}
public class SubClass : BaseClass
{
public void CallMyEvent()
{
MyEvent();
}
}
public class BaseClass {
@EventRaise(Visibility.Protected)]
public __event MyEvent: Action?
}
public class SubClass : BaseClass {
public void CallMyEvent() {
MyEvent();
}
}
public class BaseClass {
@EventRaise(Visibility.Protected)
public __event Action MyEvent;
}
public class SubClass : BaseClass {
public void CallMyEvent() {
MyEvent();
}
}
Defined in RemClasss.Elements.Cirrus.dll.
See Also
- Events
raisekeyword for Oxygene Events