コード例 #1
0
        /// <summary>
        /// 加载地图
        /// </summary>
        /// <param name="_map">地图属性</param>
        /// <param name="_objlist">地图标识物属性序列</param>
        public void LoadMap(MapProperty _map, List<EMapObject> _objlist)
        {
            while(isBusying)
            {
                Application.DoEvents();
            }

            isBusying = true;

            EMapContainer newmap = new EMapContainer();

            newmap.Property = _map;

            newmap.MapActivedEvent += new EventHandler<EventArgs>(map_MapActivedEvent);
            newmap.MapWarningEvent += new EventHandler<EventArgs>(map_MapWarningEvent);

            objlist.Clear();

            //linwei 2008-07-11 加载地图时先删除所有的智能提示,因为智能提示不能多次添加
            toolTip.RemoveAll();

            foreach (EMapObject obj in _objlist)
            {
                newmap.AddObject(obj);
                obj.Location = new Point(obj.Property.X, obj.Property.Y);

                obj.LoadPropertyEvnet += new EventHandler<EventArgs>(obj_LoadPropertyEvnet);
                obj.NextLevelEvent += new EventHandler<EventArgs>(obj_NextLevelEvent);
                obj.WatchEvent+=new EventHandler<WatchEvnetArgs>(obj_WatchEvent);
                InitObjectEvent(obj);

                objlist.Add(obj);

                GetTip(obj);
            }

            Map = newmap;

            MapSelected = true;

            m_mapindex = _map.SN;

            m_IsSaved = true;

            isBusying = false;
        }
コード例 #2
0
        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="temp">设置的属性信息</param>
        private void SetProperty(MapProperty temp)
        {
            _property = temp;

            if ((_property.Map != null) && (BackgroundImage != _property.Map))
            {
                if (null != BackgroundImage)
                {
                    if (BackgroundImage.Size.Width > _property.Map.Width || BackgroundImage.Size.Height > _property.Map.Height)
                    {
                        if (null != MapWarningEvent)
                        {
                            EventArgs e = new EventArgs();
                            MapWarningEvent(this, e);
                        }
                    }
                }

                image = _property.Map;
                Size = image.Size;
            }
        }
コード例 #3
0
        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="temp">设置的属性信息</param>
        private void SetProperty(MapProperty temp)
        {
            m_IsInit = true;

            _property = temp;

            TBox_Name.Text = _property.Name;

            if (temp.Map != null)
                TBox_Map.Text = "";// _property.Map.GetType().ToString();

            TBox_Note.Text = _property.Note;

            m_IsInit = false;
        }