Esempio n. 1
0
		public void UpdateIcons()
		{
			if(this.iconSet == null)
			{
				this.iconSet = new 
					DownloadableImageFromIconSet(this.Name,
					this.worldWindow1.CurrentWorld, 0.0f, this.worldWindow1.DrawArgs, this.worldWindow1.CurrentWorld.TerrainAccessor);
				this.iconSet.IsOn = true;
				this.worldWindow1.CurrentWorld.RenderableObjects.Add( this.iconSet );
			}

			if(this.radioButtonDisplayNone.Checked)
			{
				this.ClearAllIcons();
				this.worldWindow1.Invalidate();
				return;
			}

			lock(this.modisList.SyncRoot)
			{
				foreach(string key in this.modisList.Keys)
				{
					RapidFireModisRecord rfmr = (RapidFireModisRecord)this.modisList[key];

					DateTime date = DateTime.ParseExact(rfmr.dateString, "M/d/yyyy", CultureInfo.InvariantCulture);
					if(date > this.dateTimePickerEndDate.Value || date < this.dateTimePickerBeginDate.Value)
					{
						//date out of range...
						if(this.currentList.Contains(rfmr.Title))
							this.RemoveIconFromCurrentList(rfmr);
						continue;
					}

					bool exists;
					lock(this.currentList.SyncRoot)
					{
						exists = this.currentList.Contains(rfmr.Title);
					}

					string desc = rfmr.Description.ToLower();
					if(desc.IndexOf("fire") != -1)
						UpdateIcon( rfmr, "modis-fire.png", this.showFires, exists );
					else if(desc.IndexOf("flood") != -1)
						UpdateIcon( rfmr, "modis-flood.png", this.showFloods, exists );
					else if(desc.IndexOf("smoke") != -1 || desc.IndexOf("dust") != -1)
						UpdateIcon( rfmr, "modis-dustsmoke.png", this.showDust, exists );
					else if(desc.IndexOf("storm") != -1 ||
						desc.IndexOf("blizzard") != -1 ||
						desc.IndexOf("typhoon") != -1 ||
						desc.IndexOf("hurricane") != -1 )
					{
						UpdateIcon( rfmr, "modis-storm.png", this.showStorms, exists );
					}
					else if(desc.IndexOf("volcano") != -1)
						UpdateIcon( rfmr, "modis-volcano.png", this.showVolcanoes, exists );
					else
						UpdateIcon( rfmr, "modis-misc.png", this.showMisc, exists );
				}
			}

			this.worldWindow1.Invalidate();
		}
Esempio n. 2
0
		public void Reset()
		{
			if(this.iconSet != null)
			{
				this.worldWindow1.CurrentWorld.RenderableObjects.Remove(this.iconSet.Name);
				this.iconSet.Dispose();
				this.iconSet = null;
			}
			this.Visible = false;
		}
Esempio n. 3
0
		private void RapidFireModisManager_VisibleChanged(object sender, System.EventArgs e)
		{
			if(this.Visible)
			{
				this.UpdateIcons();
			}
			else
			{
				this.currentList.Clear();
				if(this.iconSet != null)
				{
					this.worldWindow1.CurrentWorld.RenderableObjects.Remove(this.iconSet.Name);
				
					this.iconSet.Dispose();
					this.iconSet = null;
				}
			}
		}