I need to have some delegates in my class.
I\'d like to use the interface to \"remind\" me to set these delegates.
How to?
My class look like this:
One of your comments referenced the return type of event handler. Are you more concerned with the type of the handler, or the data coming back from the event? If it's the latter, then this may help. If not, then this solution won't be enough, but may help get you closer to what you're looking for.
All you have to do is declare your event handlers as generic event handlers in both the interface and your implementation and you can customize the return results.
Your conrete class would look like this:
public class ClsPictures : myInterface
{
// Implementing the IProcess interface
public event EventHandler UpdateStatusText;
//no need for this anymore: public delegate void UpdateStatusEventHandler(string Status);
public event EventHandler Started;
//no need for this anymore: public delegate void StartedEventHandler();
}
Your interface would look like this:
public interface myInterface
{
event EventHandler Started;
event EventHandler UpdateStatusText;
}
Now that the event args are returning your types, you can hook them in any handler you define.
For reference: https://msdn.microsoft.com/en-us/library/edzehd2t(v=vs.110).aspx