I am trying to understand if all of the options below are viable. I completely understand the delegate and event usage, but Action seems to provide syntactic sugar by making it even easier (or am I missing something)? I have tested all of these and they work, but that doesn't mean they are all good patterns.
public delegate WorkCompleteDel(sting value);
public class MyClass{
//Are these all viable, safe options?
//ties the above delegate, pretty standard pattern
public event WorkCompleteDel WorkCompletedDelEvent;
//OR
//this seems to be the easiest but only supports
//on listner/subscriber. IF thats all you need, seems
//reasonble?
public Action<string> WorkCompleteHandler1 {get; set;}
//OR
//this is similar to the one below it but
//uses an action. Not sure if using he event keyword
//now gives me the ability to have multple subscibers
//(but I think it does due to multicast delegate class)
public event Action<string> WorkCompleteHandler1;
//OR
//another standard patthen
public event EventHandler<MyEventHandlerArgs> WorkCompleteHandler2
}
public class MyEventHandlerArgs: EventArgs
{
public string MyString {get; set}
}