protected override void OnBeforePopUp(object sender, EventArgs e)
        {
            if (m_ChoiceControl == null)
            {
                m_ChoiceControl = GetChoiceControl();
                m_ChoiceControl.ApplySelection      += new EventHandler(m_ChoiceControl_ApplySelection);
                m_ChoiceControl.SelectedItemChanged += new EventHandler <DateEventArgs>(m_ChoiceControl_SelectedItemChanged);

                ContentControl = m_ChoiceControl;
                PopUpContainer.PopupControl.Caption = Localization.DateChoice_Caption + "...";
            }

            UpdateButtonsState();

            BeforePopUp();

            if (NeedReload)
            {
                m_ChoiceControl.URL                      = URL;
                m_ChoiceControl.Connection               = m_Connection;
                m_ChoiceControl.CubeName                 = m_CubeName;
                m_ChoiceControl.DayLevelUniqueName       = m_DayLevelUniqueName;
                m_ChoiceControl.DateToUniqueNameTemplate = m_DateToUniqueNameTemplate;

                m_ChoiceControl.Initialize();
                NeedReload = false;
            }

            base.OnBeforePopUp(sender, e);
        }
        protected override void OnBeforePopUp(object sender, EventArgs e)
        {
            if (m_ChoiceControl == null)
            {
                m_ChoiceControl = GetChoiceControl();
                m_ChoiceControl.ApplySelection += new EventHandler(m_ChoiceControl_ApplySelection);
                m_ChoiceControl.SelectedItemChanged += new EventHandler<DateEventArgs>(m_ChoiceControl_SelectedItemChanged);

                ContentControl = m_ChoiceControl;
                PopUpContainer.PopupControl.Caption = Localization.DateChoice_Caption + "...";
            }

            UpdateButtonsState();

            BeforePopUp();

            if (NeedReload)
            {
                m_ChoiceControl.URL = URL;
                m_ChoiceControl.Connection = m_Connection;
                m_ChoiceControl.CubeName = m_CubeName;
                m_ChoiceControl.DayLevelUniqueName = m_DayLevelUniqueName;
                m_ChoiceControl.DateToUniqueNameTemplate = m_DateToUniqueNameTemplate;

                m_ChoiceControl.Initialize();
                NeedReload = false;
            }
            
            base.OnBeforePopUp(sender, e);
        }