public void CompleteTournament() { if (OnTournamentComplete != null) { OnTournamentComplete.Invoke(this, DateTime.Now); } // OnTournamentComplete?.Invoke(this, DateTime.Now); }
public void CompleteTournament() { OnTournamentComplete?.Invoke(this, DateTime.Now); }
// A method to fire off the event public void CompleteTournament() { // Check to see if there is any subscribers // Check is this event is available OnTournamentComplete?.Invoke(this, DateTime.Now); }
//Now we create the method that fires that event //We need to check the subscribers, cause id theres no subscriber, we cant fire the event public void CompleteTournament() { OnTournamentComplete?.Invoke(this, DateTime.Now); //If you have a subscriber, fire the event }
public void CompleteTournament() { OnTournamentComplete?.Invoke(this, null); }
/// <summary> /// Complete the tournament with appropriate message /// </summary> /// <param name="finalMessage"></param> public void CompleteTournament(string finalMessage) { OnTournamentComplete?.Invoke(this, finalMessage); }
public void CompleteTournamentCaller() { OnTournamentComplete?.Invoke(this, EventArgs.Empty); }
// This method fires the OnTournamentComplete event public void CompleteTournament() { // "?" This is a newer c# feature. Checks for subscribers. If there are some, then event can be fired OnTournamentComplete?.Invoke(this, DateTime.Now); // This jumps to the eventhandler, that is Tournament_OnTournamentComplete(object sender, DateTime e) }
/// <summary> /// Invoke the event /// </summary> public void CompleteTournament() { // The '?' means if it is available (i.e. there are subscribers to the event) do the extension. // If not, don't do anything OnTournamentComplete?.Invoke(this, DateTime.Now); }