Пример #1
0
        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();
                }
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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();
                }
            }
        }