public void UpdateMap(MDynamicMapUpdateInfo info) { //EventPlace AstroMapBase mapb = _maps.Where(x => x.ID == CurrentMapId).FirstOrDefault(); AstroMapBase mapc = null; if (mapb != null) { Type t = mapb.GetType(); if (t == typeof(AstroMapStaticStandAlone)) { AstroMapStaticStandAlone map = mapb as AstroMapStaticStandAlone; info.EventPlace = mapb.EventPlace; mapc = new AstromapComplex(new AstroMapStaticComplex(map), info); } else if (t == typeof(AstromapComplex)) { AstromapComplex map = mapb as AstromapComplex; info.EventPlace = map.GetStaticMap().EventPlace; mapc = new AstromapComplex(map.GetStaticMap(), info); } if (mapc != null) { _maps.Remove(mapb); _maps.Add(mapc); UpdateTab(); } } }
protected void TabPagePaint(object sender, PaintEventArgs e) { int id = (int)((TabPage)sender).Tag; AstroMapBase map = _maps.FirstOrDefault(x => x.ID == id); if (map != null) { Graphics g = Graphics.FromHwnd(tabMapsCollection.SelectedTab.Handle); map.DrawMap(g); } }
public void ResetStatic() { AstroMapBase mapb = _maps.Where(x => x.ID == CurrentMapId).FirstOrDefault(); if (mapb != null) { Type t = mapb.GetType(); if (t == typeof(AstromapComplex)) { AstromapComplex amc = mapb as AstromapComplex; AstroMapStaticStandAlone mapc = new AstroMapStaticStandAlone(amc.GetStaticMap().ID); _maps.Remove(mapb); _maps.Add(mapc); UpdateTab(); } } }