/// <summary>
        /// 如果地图发生了变化,那么地图控件和布局控件的地图也应发生变化
        /// </summary>
        /// <param name="_NewMap"></param>
        public void ReplaceMap(IMap _NewMap)
        {
            if (_NewMap == null)
            {
                throw new Exception("ControlsSynchronizer::ReplaceMap:\r\nNew map for replacement is not initialized!");
            }

            if (pPageLayoutControl == null || pMapControl == null)
            {
                throw new Exception("ControlsSynchronizer::ReplaceMap:\r\nEither MapControl or PageLayoutControl are not initialized!");
            }

            //create a new instance of IMaps collection which is needed by the PageLayout
            IMaps pMaps = new Maps();

            //add the new map to the Maps collection
            pMaps.Add(_NewMap);

            bool bIsMapActive = pIsMapControlactive;

            //call replace map on the PageLayout in order to replace the focus map
            //we must call ActivatePageLayout, since it is the control we call 'ReplaceMaps'
            this.ActivatePageLayout();
            pPageLayoutControl.PageLayout.ReplaceMaps(pMaps);


            //assign the new map to the MapControl
            pMapControl.Map = _NewMap;

            //reset the active tools
            pPageLayoutActiveTool = null;
            pMapActiveTool        = null;

            //make sure that the last active control is activated
            if (bIsMapActive)
            {
                this.ActivateMap();
                pMapControl.ActiveView.Refresh();
            }
            else
            {
                this.ActivatePageLayout();
                pPageLayoutControl.ActiveView.Refresh();
            }
        }
        /// <summary>
        /// 当运行应用程序的时候,即便没有加载地图,则创建一个空的地图,让这两个控件和这个地图绑定在一起,这样就能保持一致
        /// </summary>
        /// <param name="activateMapFirst">true if the MapControl supposed to be activated first</param>
        public void BindControls(bool _ActivateMapFirst)
        {
            if (pPageLayoutControl == null || pMapControl == null)
            {
                throw new Exception("ControlsSynchronizer::BindControls:\r\nEither MapControl or PageLayoutControl are not initialized!");
            }

            //创建一个地图实例
            IMap pNewMap = new MapClass();

            pNewMap.Name = "Map";

            //其中Maps为我们创建的一个类,表示的是地图的集合
            IMaps pMaps = new Maps();

            //add the new Map instance to the Maps collection
            pMaps.Add(pNewMap);

            //call replace map on the PageLayout in order to replace the focus map
            pPageLayoutControl.PageLayout.ReplaceMaps(pMaps);
            //assign the new map to the MapControl
            pMapControl.Map = pNewMap;

            //reset the active tools
            pPageLayoutActiveTool = null;

            pMapActiveTool = null;

            //make sure that the last active control is activated
            if (_ActivateMapFirst)
            {
                this.ActivateMap();
            }
            else
            {
                this.ActivatePageLayout();
            }
        }
        /// <summary>
        /// �����ͼ�����˱仯����ô��ͼ�ؼ��Ͳ��ֿؼ��ĵ�ͼҲӦ�����仯
        /// </summary>
        /// <param name="_NewMap"></param>
        public void ReplaceMap(IMap _NewMap)
        {
            if (_NewMap == null)
            throw new Exception("ControlsSynchronizer::ReplaceMap:\r\nNew map for replacement is not initialized!");

              if (pPageLayoutControl == null || pMapControl == null)
            throw new Exception("ControlsSynchronizer::ReplaceMap:\r\nEither MapControl or PageLayoutControl are not initialized!");

              //create a new instance of IMaps collection which is needed by the PageLayout
              IMaps pMaps = new Maps();
              //add the new map to the Maps collection
              pMaps.Add(_NewMap);

              bool bIsMapActive = pIsMapControlactive;

              //call replace map on the PageLayout in order to replace the focus map
              //we must call ActivatePageLayout, since it is the control we call 'ReplaceMaps'
              this.ActivatePageLayout();
              pPageLayoutControl.PageLayout.ReplaceMaps(pMaps);

              //assign the new map to the MapControl
              pMapControl.Map = _NewMap;

              //reset the active tools
              pPageLayoutActiveTool = null;
              pMapActiveTool = null;

              //make sure that the last active control is activated
              if (bIsMapActive)
              {
            this.ActivateMap();
            pMapControl.ActiveView.Refresh();
              }
              else
              {
            this.ActivatePageLayout();
            pPageLayoutControl.ActiveView.Refresh();
              }
        }
        /// <summary>
        /// ������Ӧ�ó����ʱ�򣬼���û�м��ص�ͼ���򴴽�һ���յĵ�ͼ�����������ؼ��������ͼ����һ���������ܱ���һ��
        /// </summary>
        /// <param name="activateMapFirst">true if the MapControl supposed to be activated first</param>
        public void BindControls(bool _ActivateMapFirst)
        {
            if (pPageLayoutControl == null || pMapControl == null)
            throw new Exception("ControlsSynchronizer::BindControls:\r\nEither MapControl or PageLayoutControl are not initialized!");

              //����һ����ͼʵ��
              IMap pNewMap = new MapClass();

              pNewMap.Name = "Map";

              //����MapsΪ���Ǵ�����һ���࣬��ʾ���ǵ�ͼ�ļ���
              IMaps pMaps = new Maps();
              //add the new Map instance to the Maps collection
              pMaps.Add(pNewMap);

              //call replace map on the PageLayout in order to replace the focus map
              pPageLayoutControl.PageLayout.ReplaceMaps(pMaps);
              //assign the new map to the MapControl
              pMapControl.Map = pNewMap;

              //reset the active tools
              pPageLayoutActiveTool = null;

              pMapActiveTool = null;

              //make sure that the last active control is activated
              if (_ActivateMapFirst)
            this.ActivateMap();
              else
            this.ActivatePageLayout();
        }