views:

59

answers:

1

Hello everybody

this works

public event Func<int,int> createEvents;

but why not this ?

public event Action<int> createEvents;
+1  A: 

public event Action<int> CreateEvents;

Is completely valid. Maybe your Event Handling method does not match with the Action<T> delegate.

Maybe you have something like this:

    public event Action<int> CreateEvents;
    public event Func<int, int> CreateEvents2;

    public int OnCreateEvents2(int value)
    {
        Func<int, int> handler = CreateEvents2;
        if (handler != null) return handler(value);

        return 0;
    }

    public void OnCreateEvents(int value)
    {
        Action<int> handler = CreateEvents;
        if (handler != null) handler(value);
    }
Markust
Yes, now i tried and it worked but i don't know what i have done wrong before
Freshblood