Hi there,
What I am doing at the moment is I am creating a class which will eventually go into a dll which can be included in other peoples projects.
Within that class I have some events which are triggered so that the application that had this library linked can update and do whatever it wants with the information.
The class is NOT static.
So here is the code I am using and it works:
and then for my main program to handle that event i simply use this:
This works fine and it handles the events fine.
My main question is, do I have to have the static "logstuff" void in the class, because it is sitting there doing nothing? If so how do I do this? If not, why not?
Thanks.
What I am doing at the moment is I am creating a class which will eventually go into a dll which can be included in other peoples projects.
Within that class I have some events which are triggered so that the application that had this library linked can update and do whatever it wants with the information.
The class is NOT static.
So here is the code I am using and it works:
Code:
public delegate void LogUpdateEvent(LogMessage Message);
public event LogUpdateEvent LogUpdated = new LogUpdateEvent(logstuff);
public static void logstuff(LogMessage hey)
{}
and then for my main program to handle that event i simply use this:
Code:
mvBrab.LogUpdated += new class.class.LogUpdateEvent(mvBrab_LogUpdated);
This works fine and it handles the events fine.
My main question is, do I have to have the static "logstuff" void in the class, because it is sitting there doing nothing? If so how do I do this? If not, why not?
Thanks.
Last edited: