Skip to content

Event support

Compare
Choose a tag to compare
@pgenfer pgenfer released this 13 Aug 22:32
· 8 commits to master since this release

The following issues are implemented / fixed

Forwarding to mixin events is now supported:

If the mixin declares an event

public class NameMixin
{
    public event EventHandler NameChanged;
}

The generated code will include the event in the child class and event access will be forwarded to the mixin:

// child class that includes the mixin
public class Person
{
    private NameMixin _name = new NameMixin();

    public event EventHandler NameChanged
    {
        add { _name.NameChanged += value; }
        remove { _name.NameChanged -= value; }
    }
}