예제 #1
0
        public void AddRoad(int length, City c1, City c2) //добавить дорогу
        {
            Road road = new GenericGraph.Road(length);

            road.Connections[0] = c1;
            road.Connections[1] = c2;
            MainGraph.AddEdge(road, c1, c2);
        }
예제 #2
0
 private void BtnAddEdge_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Edge newEdge = new Edge(MainGraphName + _MainGraph.EdgeCollection.Count().ToString(), SelectedStartPoint, SelectedEndPoint);
         MainGraph.AddEdge(newEdge);
         NotifyPropertyChanged("MainGraph");
         TaskAnswer = GraphUtils.IsDirectedTree(MainGraph);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Ошибка добавления");
     }
 }