//end added by chulili

        public override void OnClick()
        {
            if (ModData.SysLog != null)
            {
                ModData.SysLog.Write("历史数据管理", null, DateTime.Now);
            }
            else
            {
                ModData.SysLog = new SysCommon.Log.clsWriteSystemFunctionLog();
                ModData.SysLog.Write("历史数据管理", null, DateTime.Now);
            }
            try
            {
                UserControlDBATool userControlDBATool = ModData.v_AppGIS.MainUserControl as UserControlDBATool;
                if (userControlDBATool == null)
                {
                    return;
                }

                if (!m_bChecked)
                {
                    //cyf 20110705 modify
                    m_controlHistoryBar = new ControlHistoryBar(m_Hook.ArcGisMapControl, m_Hook.TOCControl, m_Hook.ProjectTree, userControlDBATool._frmBarManager.BarHistoryDataCompare, userControlDBATool._frmBarManager.MainDotNetBarManager);
                    //end
                    userControlDBATool.ToolControl.Controls.Add(m_controlHistoryBar.BarHistoryManage);
                    userControlDBATool.ToolControl.Controls.SetChildIndex(m_controlHistoryBar.BarHistoryManage, 0);

                    userControlDBATool.ToolControl.Controls.Remove(m_controlHistoryBar.BarHistoryManage);
                    userControlDBATool.ToolControl.Controls.Remove(ModData.v_AppGIS.ArcGisMapControl);
                    userControlDBATool.ToolControl.Controls.Remove(userControlDBATool.MapToolBar);
                    userControlDBATool.ToolControl.Controls.Add(ModData.v_AppGIS.ArcGisMapControl);
                    userControlDBATool.ToolControl.Controls.Add(userControlDBATool.MapToolBar);
                    userControlDBATool.ToolControl.Controls.Add(m_controlHistoryBar.BarHistoryManage);

                    userControlDBATool._frmBarManager.MainDotNetBarManager.RightDockSite.Controls.Add(userControlDBATool._frmBarManager.BarHistoryDataCompare);
                    userControlDBATool._frmBarManager.MainDotNetBarManager.RightDockSite.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
                        ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(userControlDBATool._frmBarManager.BarHistoryDataCompare, 664, 126)))
                    }, DevComponents.DotNetBar.eOrientation.Vertical);
                    userControlDBATool._frmBarManager.BarHistoryDataCompare.Size    = new System.Drawing.Size(362, 228);
                    userControlDBATool._frmBarManager.BarHistoryDataCompare.Visible = false;
                    m_bChecked = !m_bChecked;
                }
                else
                {
                    if (!IsHistory)
                    {
                        if (m_controlHistoryBar != null)    //cyf 20110713 modify
                        {
                            userControlDBATool.ToolControl.Controls.Remove(m_controlHistoryBar.BarHistoryManage);
                        }
                        m_controlHistoryBar = null;
                        // m_Hook.MapControl.ClearLayers();
                        ClearHisLayer();
                        m_Hook.TOCControl.Update();

                        userControlDBATool._frmBarManager.BarHistoryDataCompare.Items.Clear();
                        DevComponents.DotNetBar.DockContainerItem  dockItemHistoryData = new DevComponents.DotNetBar.DockContainerItem("dockItemHistoryData0", "历史数据对比浏览");
                        DevComponents.DotNetBar.PanelDockContainer PanelTipHistoryData = new DevComponents.DotNetBar.PanelDockContainer();
                        frmArcgisMapControl newFrmArcgisMapControl = new frmArcgisMapControl();
                        newFrmArcgisMapControl.ArcGisMapControl.Dock = DockStyle.Fill;
                        PanelTipHistoryData.Controls.Add(newFrmArcgisMapControl.ArcGisMapControl);
                        dockItemHistoryData.Control = PanelTipHistoryData;
                        userControlDBATool._frmBarManager.BarHistoryDataCompare.Items.Add(dockItemHistoryData);
                        userControlDBATool._frmBarManager.MainDotNetBarManager.RightDockSite.Controls.Remove(userControlDBATool._frmBarManager.BarHistoryDataCompare);
                        userControlDBATool._frmBarManager.BarHistoryDataCompare.Visible = false;
                        m_bChecked = !m_bChecked;
                    }
                    //end
                }
            }
            catch (Exception err)
            {
                //*******************************************************************
                //guozheng added
                if (ModData.SysLog != null)
                {
                    ModData.SysLog.Write(err, null, DateTime.Now);
                }
                else
                {
                    ModData.SysLog = new SysCommon.Log.clsWriteSystemFunctionLog();
                    ModData.SysLog.Write(err, null, DateTime.Now);
                }
                //********************************************************************

                SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("错误", "原因:" + err.Message);
            }
        }
        //added by chulili 20110720初始化历史工具
        //现在加载历史数据的概念有所改变(以前每次都是加载所有历史,现在可以分数据集分图层加载历史)
        //(以前加载完了不能再次加载,现在可以多次加载)
        public void InitHistoryBar()
        {
            if (ModData.SysLog != null)
            {
                ModData.SysLog.Write("历史数据管理", null, DateTime.Now);
            }
            else
            {
                ModData.SysLog = new SysCommon.Log.clsWriteSystemFunctionLog();
                ModData.SysLog.Write("历史数据管理", null, DateTime.Now);
            }
            try
            {
                UserControlDBATool userControlDBATool = ModData.v_AppGIS.MainUserControl as UserControlDBATool;
                if (userControlDBATool == null)
                {
                    return;
                }

                if (!m_bChecked)
                {
                    //cyf 20110705 modify
                    if (m_controlHistoryBar == null)
                    {
                        m_controlHistoryBar = new ControlHistoryBar(m_Hook.ArcGisMapControl, m_Hook.TOCControl, m_Hook.ProjectTree, userControlDBATool._frmBarManager.BarHistoryDataCompare, userControlDBATool._frmBarManager.MainDotNetBarManager);
                        //end
                        userControlDBATool.ToolControl.Controls.Add(m_controlHistoryBar.BarHistoryManage);
                        userControlDBATool.ToolControl.Controls.SetChildIndex(m_controlHistoryBar.BarHistoryManage, 0);

                        userControlDBATool.ToolControl.Controls.Remove(m_controlHistoryBar.BarHistoryManage);
                        userControlDBATool.ToolControl.Controls.Remove(ModData.v_AppGIS.ArcGisMapControl);
                        userControlDBATool.ToolControl.Controls.Remove(userControlDBATool.MapToolBar);
                        userControlDBATool.ToolControl.Controls.Add(ModData.v_AppGIS.ArcGisMapControl);
                        userControlDBATool.ToolControl.Controls.Add(userControlDBATool.MapToolBar);
                        userControlDBATool.ToolControl.Controls.Add(m_controlHistoryBar.BarHistoryManage);

                        userControlDBATool._frmBarManager.MainDotNetBarManager.RightDockSite.Controls.Add(userControlDBATool._frmBarManager.BarHistoryDataCompare);
                        userControlDBATool._frmBarManager.MainDotNetBarManager.RightDockSite.DocumentDockContainer = new DevComponents.DotNetBar.DocumentDockContainer(new DevComponents.DotNetBar.DocumentBaseContainer[] {
                            ((DevComponents.DotNetBar.DocumentBaseContainer)(new DevComponents.DotNetBar.DocumentBarContainer(userControlDBATool._frmBarManager.BarHistoryDataCompare, 664, 126)))
                        }, DevComponents.DotNetBar.eOrientation.Vertical);
                        userControlDBATool._frmBarManager.BarHistoryDataCompare.Size    = new System.Drawing.Size(362, 228);
                        userControlDBATool._frmBarManager.BarHistoryDataCompare.Visible = false;
                    }
                    m_bChecked = !m_bChecked;
                }
            }
            catch (Exception err)
            {
                //*******************************************************************
                //guozheng added
                if (ModData.SysLog != null)
                {
                    ModData.SysLog.Write(err, null, DateTime.Now);
                }
                else
                {
                    ModData.SysLog = new SysCommon.Log.clsWriteSystemFunctionLog();
                    ModData.SysLog.Write(err, null, DateTime.Now);
                }
                //********************************************************************

                SysCommon.Error.ErrorHandle.ShowFrmErrorHandle("错误", "原因:" + err.Message);
            }
        }