Пример #1
0
        public void Dispose()
        {
            SimulationModel.Dispose();
            Roads.Remove(this);

            Canvas.Children.Remove(View);

            RouteCore.DisposeBy(this);
            GC.SuppressFinalize(this);
        }
Пример #2
0
 private static void DisposeBy(IHoldBusesUI place, RouteCore route)
 {
     foreach (var way in route.ways)
     {
         if (way == place)
         {
             route.Dispose();
         }
     }
 }
Пример #3
0
 public BusCore(RouteCore _route, int _delay, Canvas _canvas)
 {
     delay   = _delay;
     route   = _route;
     Current = null;
     bus     = new Bus(delay);
     view    = new BusView
     {
         DataContext = new BusViewModel(bus),
     };
     canvas = _canvas;
     //(route.SimulationModel as Route).AddBus(bus);
     //Current.AddBus(this);
 }