public LayerWindow(object hook)
        {
            InitializeComponent();
            try
            {
                s_userControl = this;
                s_userControl.Resize += tbCntlDisplay_Resize;
                s_tbCntlDisplay = tbCntlDisplay;
                s_gpBoxOptions = gpBoxOptions;

                s_cboLayers = cboLayers;
                s_BtnNext = btnNext;
                s_BtnRefresh = btnRefresh;
                s_BtnZoomTo = btnZoomTo;
                s_BtnPrevious = btnPrevious;
                s_splContMain = splContMain;
                s_chkZoomToOnAdvance = chkZoomToOnAdvance;
                s_txtScale = txtScale;
                s_txtQuery = txtQuery;
                s_lblCount = lblCount;
                s_lblCount.Text = "";
                s_splContMain.Resize += s_splContMain_Resize;

                s_BtnNext.Click += s_BtnNextClick;
                s_BtnRefresh.Click += s_BtnRefreshClick;
                s_BtnZoomTo.Click += s_BtnZoomToClick;
                s_BtnPrevious.Click += s_BtnPreviousClick;
                s_cboLayers.SelectedIndexChanged += s_cboLayers_SelectedIndexChanged;
                s_gpBoxOptions.Click += s_gpBoxOptions_Click;

                // Add any initialization after the InitializeComponent() call.
                this.Hook = hook;
                 m_layCfg = ConfigUtil.GetLayerViewerConfig();
                 if (m_layCfg != null)
                {
                    s_chkZoomToOnAdvance.Checked = m_layCfg.ZoomOnRecordChange;

                    //if (m_node.Attributes["zoomScale"] != null)
                    //{
                    //    s_txtScale.Text = m_node.Attributes["zoomScale"].Value;

                    //}
                }
             //   _app = (IApplication)(hook);
             //   IDocumentEvents_Event s_docEvent = (IDocumentEvents_Event)(IMxDocument)_app.Document;

                ArcMap.Events.NewDocument += ArcMap_NewDocument;
                ArcMap.Events.OpenDocument += ArcMap_OpenDocument;
              //  s_docEvent.NewDocument += ArcMap_NewDocument;
               // s_docEvent.OpenDocument += ArcMap_OpenDocument;

                Initialize();

                initAddin();
                s_gpBoxOptions.Height = 15;
                CenterButton();
                setButtonState();
                ReloadMonitor.reloadConfig += new ReloadEventHandler(reloadOccured);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in the LayerWindow - New" + Environment.NewLine + ex.Message);

            }
        }
        private void reloadOccured(object sender, EventArgs e)
        {
            m_layCfg = ConfigUtil.GetLayerViewerConfig();
            if (m_layCfg != null)
            {
                s_chkZoomToOnAdvance.Checked = m_layCfg.ZoomOnRecordChange;

            }
            initAddin();
            s_gpBoxOptions.Height = 15;
            CenterButton();
            setButtonState();
        }