There is no such thing as "call a delegate". A delegate instance is
invoked, which is a very different things: all the handlers from its
invocation list get called. This is done like this:
if (OnGetStatus != null)
OnGetStatus.Invoke(this, new StatusEventArgs());
You can invoke this event only in this class (declared class), nowhere else, which is an important fool-proof feature.
Here, I made up the type
StatusEvenArgs
assuming that you are using the common event declaration pattern:
class StatusEventArgs : System.EventArgs { }
public class EacApi {
public event System.EventHandler<StatusEventArgs> OnGetStatus;
}
If you are doing something else, resort to this pattern. If, by some reason, you want to invoke event somehow else you should… review your code design; it's now going to happen. If this is the case, better explain your ultimate goal, they I would, most likely, be able to suggest a solution.
—SA