/// <summary> /// Raises the <see cref="E:PathComplete" /> event. /// </summary> /// <param name="inPathCompletionData">The <see cref="PathCompleteEventArgs"/> instance containing the event data.</param> private void OnPathComplete(PathCompleteEventArgs inPathCompletionData) { EventHandler <PathCompleteEventArgs> theHandler = PathComplete; if (theHandler != null) { theHandler(this, inPathCompletionData); } }
/// <summary> /// Detects whether the specified symbol has won. /// </summary> /// <param name="inContender">The contender.</param> private void DetectAWinFor(CellState inContender) { if (myCells.Count(x => x.State == inContender) == Constant.GridDimension) { // The specified contender has won. PathCompleteEventArgs thePathCompletionData = new PathCompleteEventArgs { WinningSymbol = inContender }; OnPathComplete(thePathCompletionData); } }
/// <summary> /// Raises the <see cref="E:PathComplete" /> event. /// </summary> /// <param name="inPathCompletionData">The <see cref="PathCompleteEventArgs"/> instance containing the event data.</param> private void OnPathComplete(PathCompleteEventArgs inPathCompletionData) { EventHandler<PathCompleteEventArgs> theHandler = PathComplete; if (theHandler != null) { theHandler(this, inPathCompletionData); } }
/// <summary> /// Handles the PathComplete event of the GameState control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void GameState_PathComplete(object sender, PathCompleteEventArgs e) { // Set the winning symbol. WinningSymbol = e.WinningSymbol; }