G
Guest
Anyone have an example of defining a custom event (i.e custom delegate) in an
interface?
interface?
Nicholas Paldino said:Anthony,
You mean like this:
public interface IMyInterface
{
public event EventHandler MyEvent;
}
That should give you what you want.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Anthony Yott said:Anyone have an example of defining a custom event (i.e custom delegate) in
an
interface?
Nicholas Paldino said:Anthony,
You mean like this:
public interface IMyInterface
{
public event EventHandler MyEvent;
}
That should give you what you want.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Anthony Yott said:Anyone have an example of defining a custom event (i.e custom delegate) in
an
interface?
Anthony Yott said:Nicholas,
I think the big question (for me) is how to define the delegte type for
the
event in the interface so that it is availble to COM clients; otherwise
I'm
not sure how the COM client can subscribe to the event if it doesn't know
the
event target type.
--
Anthony Yott
Nicholas Paldino said:Anthony,
You mean like this:
public interface IMyInterface
{
public event EventHandler MyEvent;
}
That should give you what you want.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Anthony Yott said:Anyone have an example of defining a custom event (i.e custom delegate)
in
an
interface?