예제 #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
        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();
                }
            }
        }
예제 #3
0
        private void OnCreateMapByKeyword(object sender, EventArgs e)
        {
            MVwPeopleKeyWord person = null;

            using (dlgCreateMapByKW dlg = new dlgCreateMapByKW())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    person = dlg.SelectedPerson;
                }
            }
            if (person != null)
            {
                AstroMapStaticStandAlone map = new AstroMapStaticStandAlone(person.IdPerson);
                _maps.Add(map);
                TabPage tp = CreateNewTab(person.IdPerson);
                CurrentMapId = person.IdPerson;
            }
        }
예제 #4
0
        private void OnCreateMapById(object sender, EventArgs e)
        {
            MPersonBase person = null;

            using (dlgCreateMapByID dlg = new dlgCreateMapByID())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    person = dlg.Person;
                }
            }
            if (person != null)
            {
                TabPage tp = CreateNewTab(person.Id);
                CurrentMapId = person.Id;

                AstroMapStaticStandAlone map = new AstroMapStaticStandAlone(person);
                _maps.Add(map);
            }
        }
예제 #5
0
        private void testMapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MPersonBase person = new MPersonBase()
            {
                BirthDay        = 1,
                BirthHourFrom   = 1,
                AdditionalHours = 1,
                BirthHourTo     = 2,
                BirthMinFrom    = 1,
                BirthMinTo      = 2,
                BirthMonth      = 1,
                BirthSecFrom    = 0,
                BirthSecTo      = 0,
                BirthYear       = 2000,
                FirstName       = "Vasya",
                SecondName      = "Pupkind",
                Place           = 2
            };
            AstroMapStaticStandAlone map = new AstroMapStaticStandAlone(person);
            Graphics g = System.Drawing.Graphics.FromHwnd(tabMapsCollection.TabPages[0].Handle);

            map.DrawMap(g);
        }
예제 #6
0
        private void OnCreateMapManually(object sender, EventArgs e)
        {
            using (dlgCreateMapManually dlg = new dlgCreateMapManually())
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    dlg.Close();
                    Random rnd = new Random();
                    int    id  = rnd.Next(Constants.CustomIdMap, Int32.MaxValue);

                    TabPage     tp     = CreateNewTab(id);
                    MPersonBase person = new MPersonBase();
                    person.Id            = id;
                    person.BirthDay      = (byte)dlg.Day;
                    person.BirthHourFrom = person.BirthHourTo = (byte)dlg.Hour;
                    person.BirthMinFrom  = person.BirthMinTo = (byte)dlg.Min;
                    person.BirthMonth    = (byte)dlg.Month;
                    person.BirthYear     = (short)dlg.Year;
                    person.Place         = dlg.PLaceId;
                    AstroMapStaticStandAlone map = new AstroMapStaticStandAlone(person);
                    _maps.Add(map);
                }
            }
        }