G
Guest
Ok, I have a class called 'publisher' which exposes a delegate event as
follows:
public event subscriberDelegate subscribers;
The definition of subscriberDelegate being:
public delegate void subscriberDelegate(uint nValue);
I also have a 'subscriber' class which exposes a function that conforms to
the subscriberDelegate as follows:
public void Insert(uint nValue)
I've connected all this up and it's working fine. However, I'm now
attempting to write a function which can be passed the publishers event and
the subscribers function and then connects them together.
My initial idea was as follows:
void Connect(event subscriberDelegate evt, subscriberDelegate delegate)
{
evt+=delegate;
}
But I get a compiler error on the first parameter stating that a type is
required. Anyone got any suggestions how I can accomplish this?
follows:
public event subscriberDelegate subscribers;
The definition of subscriberDelegate being:
public delegate void subscriberDelegate(uint nValue);
I also have a 'subscriber' class which exposes a function that conforms to
the subscriberDelegate as follows:
public void Insert(uint nValue)
I've connected all this up and it's working fine. However, I'm now
attempting to write a function which can be passed the publishers event and
the subscribers function and then connects them together.
My initial idea was as follows:
void Connect(event subscriberDelegate evt, subscriberDelegate delegate)
{
evt+=delegate;
}
But I get a compiler error on the first parameter stating that a type is
required. Anyone got any suggestions how I can accomplish this?