/// <summary> /// A method triggered by the DataCleared event that clears all point information /// </summary> /// <param name="sender">The solver that sent the event</param> /// <param name="args">The event arguments</param> private void OnDataCleared(object sender, EventArgs args) { AddedOrder.Clear(); PlotSeries.Points.Clear(); PlotInfo.InvalidatePlot(true); }
/// <summary> /// A method triggered by the CityAdded event that adds the point to the graph /// </summary> /// <param name="sender">The solver sending the message</param> /// <param name="args">The information about the city added</param> private void OnCityAdded(object sender, CityAddedEventArgs args) { // Add to the AddedOrder list to keep track of order AddedOrder.Add(args.AddedCity); // Plot the new point on the graph var point = new DataPoint(args.AddedCity.XPosition, args.AddedCity.YPosition); PlotSeries.Points.Insert(args.Index, point); // Update the UI NotifyOfPropertyChange(nameof(AddedOrder)); PlotInfo.InvalidatePlot(true); }
public override int GetHashCode() { return(AddedOrder.GetHashCode() * 7 + GetType().GetHashCode()); }