示例#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);
 }