Esempio n. 1
0
        private void OnChangeTimer(object sender, EventArgs e)
        {
            if (IsDisposed)
            {
                return;
            }

            var page = (PageType)tabControl.SelectedIndex;

            switch (page)
            {
            case PageType.Header:
                m_Template.Header.Text            = this.htmlReportHeaderControl.InnerHtml ?? "";
                m_Template.Header.Enabled         = headerEnabledCheckbox.Checked;
                m_Template.Header.WantDivider     = headerDividerCheckbox.Checked;
                m_Template.Header.BackColor       = this.htmlReportHeaderControl.BackColor;
                m_Template.Header.PixelHeightText = this.headerHeightCombobox.Text;
                break;

            case PageType.Title:
                m_Template.Title.Text         = this.htmlReportTitleControl.InnerHtml ?? "";
                m_Template.Title.Enabled      = titleEnabledCheckbox.Checked;
                m_Template.Title.SeparatePage = this.titleSeparatePageCheckbox.Checked;
                break;

            case PageType.Tasks:
                if (!this.tableHeaderRowCombobox.DroppedDown)
                {
                    // Only update if the header row combo is NOT dropped down
                    // else it's inconsistent with the rest of the updates
                    m_Template.Task.Text           = this.htmlReportTasksControl.InnerHtml ?? "";
                    m_Template.Task.Enabled        = true;                      // always
                    m_Template.Task.TableHeaderRow = this.tableHeaderRowCombobox.SelectedOption;
                }
                break;

            case PageType.Footer:
                m_Template.Footer.Text            = this.htmlReportFooterControl.InnerHtml ?? "";
                m_Template.Footer.Enabled         = footerEnabledCheckbox.Checked;
                m_Template.Footer.WantDivider     = footerDividerCheckbox.Checked;
                m_Template.Footer.BackColor       = this.htmlReportFooterControl.BackColor;
                m_Template.Footer.PixelHeightText = this.footerHeightCombobox.Text;
                break;
            }

            if (!m_Template.Equals(m_PrevTemplate))
            {
                m_ChangeTimer.Stop();

                OnChangeTemplate(page, m_PrevTemplate, m_Template);

                m_PrevTemplate.Copy(m_Template);
                m_EditedSinceLastSave = true;

                m_ChangeTimer.Start();
            }

            // always
            UpdateToolbar();
        }
        private void CheckRefreshPreview()
        {
            if (!m_Template.Equals(m_PrevTemplate))
            {
                m_ChangeTimer.Stop();

                m_PrevTemplate.Copy(m_Template);
                RefreshPreview();

                m_ChangeTimer.Start();
            }
        }