public void Dispose() { SimulationModel.Dispose(); Roads.Remove(this); Canvas.Children.Remove(View); RouteCore.DisposeBy(this); GC.SuppressFinalize(this); }
private static void DisposeBy(IHoldBusesUI place, RouteCore route) { foreach (var way in route.ways) { if (way == place) { route.Dispose(); } } }
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); }