void AddStation (Station station) { items.Add (new StationDockItem (station)); items.Cast <StationDockItem> ().Where (s => s.OwnedStation.ID < 0).ToList ().ForEach (sdi => { items.Remove (sdi); sdi.Dispose (); }); Items = items; }
void RemoveStation (Station station) { StationDockItem sdi = items.Cast <StationDockItem> ().Where (s => s.OwnedStation == station).First (); items.Remove (sdi); MaybeAddNullStation (); Items = items; sdi.Dispose (); }
public StationDockItem (Station station) { State |= ItemState.Wait; HoverText = Catalog.GetString ("Fetching Information..."); OwnedStation = station; if (OwnedStation.ForcePixbuf != null) ForcePixbuf = OwnedStation.ForcePixbuf.Copy (); else Icon = OwnedStation.Icon; OwnedStation.FinishedLoading += delegate { SetInfo (); }; if (OwnedStation.IsLoaded) SetInfo (); }
public StationsUpdatedEventArgs (Station station, StationUpdateAction action) { this.Station = station; this.UpdateAction = action; }
public static Station LookupStation (int id) { lock (Stations) { if (Stations.Where (s => s.ID == id).Any ()) return Stations.First (s => s.ID == id); //the station wasn't in our list, so create one and add it Station station = new Station (id); Stations.Add (station); return station; } }
public StationsUpdatedEventArgs(Station station, StationUpdateAction action) { this.Station = station; this.UpdateAction = action; }