예제 #1
0
 public void ExpireArrival(Arrival arrival)
 {
     if (Arrivals.Contains(arrival))
     {
         Arrivals.Remove(arrival);
     }
 }
예제 #2
0
 private void DeleteFlight()
 {
     if (SelectedFlight != null)
     {
         string       message = "Delete flight" + SelectedFlight.TripNumber + " " + SelectedFlight.TownFrom + "-" + SelectedFlight.TownTo + " on " + SelectedFlight.Date + " without possibility of recovery?";
         string       caption = "Delete Flight";
         DialogResult result  = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes && SelectedFlight != null && SelectedFlight.DepOrArrFlag.Equals("departure"))
         {
             FlightsViewModel.DeleteFlight(SelectedFlight);
             Departures.Remove(SelectedFlight);
             SelectedDepFlight          = null;
             DepFlightDetailsVisibility = "Hidden";
             ShowFlightDetails("departure");
         }
         if (result == DialogResult.Yes && SelectedFlight != null && SelectedFlight.DepOrArrFlag.Equals("arrival"))
         {
             FlightsViewModel.DeleteFlight(SelectedFlight);
             Arrivals.Remove(SelectedFlight);
             SelectedArrFlight          = null;
             ArrFlightDetailsVisibility = "Hidden";
             ShowFlightDetails("arrival");
         }
     }
 }
예제 #3
0
    public bool RemoveArrival(Edge edge, bool fireEvent)
    {
        edge.Changed -= OnEdgeEvent;
        bool success = Arrivals.Remove(edge);

        if (success)
        {
            RefreshEdges();
            if (fireEvent)
            {
                OnNodeChanged();
            }
        }

        return(success);
    }
예제 #4
0
    /// <summary>
    ///
    /// </summary>
    public void ClearArrivals()
    {
        if (this.Arrivals.Count == 0)
        {
            return;
        }

        List <Edge> concurrentArrivals = new List <Edge>(Arrivals);

        foreach (Edge deleteEdge in concurrentArrivals)
        {
            Arrivals.Remove(deleteEdge);
            RefreshEdges();
            deleteEdge.Delete();
        }

        this.arrivals = new List <Edge>();
        RefreshEdges();
    }