/// <summary> /// Initialize our island view /// </summary> /// <param name="MainMap"></param> public MM_Island_View(MM_Network_Map_DX MainMap) { InitializeComponent(); this.MainMap = MainMap; this.Text = "Island Summary - Macomber MapĀ®"; this.Icon = Properties.Resources.CompanyIcon; Data_Integration.IslandAdded += Data_Integration_IslandAdded; Data_Integration.IslandRemoved += Data_Integration_IslandRemoved; foreach (MM_Island Island in MM_Repository.Islands.Values) { MM_Island_Display IslandDisplay = new MM_Island_Display(Island, this); Islands.Add(Island.ID, IslandDisplay); dgvIslandView.Elements.Add(IslandDisplay); } }
/// <summary> /// Handle an island addition /// </summary> /// <param name="Island"></param> private void Data_Integration_IslandAdded(MM_Island Island) { if (Island != null && !float.IsNaN(Island.Frequency)) { if (!Islands.ContainsKey(Island.ID)) { if (InvokeRequired) { Invoke(new Data_Integration.IslandChangeDelegate(Data_Integration_IslandAdded), Island); } else { MM_Island_Display IslandDisplay = new MM_Island_Display(Island, this); Islands.Add(Island.ID, IslandDisplay); dgvIslandView.Elements.Add(IslandDisplay); } } } }