예제 #1
0
		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;
		}
예제 #2
0
		void RemoveStation (Station station)
		{
			StationDockItem sdi = items.Cast <StationDockItem> ().Where (s => s.OwnedStation == station).First ();
			
			items.Remove (sdi);
			
			MaybeAddNullStation ();
			
			Items = items;
			
			sdi.Dispose ();
		}
예제 #3
0
		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;
		}
예제 #5
0
		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;
			}
		}
예제 #6
0
 public StationsUpdatedEventArgs(Station station, StationUpdateAction action)
 {
     this.Station      = station;
     this.UpdateAction = action;
 }