Yes, because you never know when "someone" might clear all listeners.
Don't worry though... C# has a great short-cut method for this... the Null-Conditional operator ?.
public class LocationEventArgs : EventArgs
{
public int Index;
public Point Location;
}
public event EventHandler<LocationEventArgs> ActorLocationUpdated;
private void
textBoxLocation_Leave(object sender,
EventArgs e)
{
ActorLocationUpdated?.Invoke(this, new
LocationEventArgs() { Location = ActorLocation, Index = ActorIndex });
Comments
Post a Comment