/// <summary>
        /// 轉點字並預覽明眼字列印結果(只能預覽,不真的印出)。
        /// </summary>
        private void ConvertAndPrintPreview()
        {
            if (!HasDefaultTextPrinter())
            {
                MessageBox.Show("尚未選擇預設印表機!");

                if (!SetDefaultPreviewPrinter())
                {
                    return;
                }
            }

            string brlFileName = null;

            if (!ConvertTextToBraille(rtbOrg.Text, out brlFileName))
            {
                return;
            }

            m_BusyForm = new BusyForm
            {
                Message = "正在載入點字資料..."
            };
            m_BusyForm.Show();
            m_BusyForm.UseWaitCursor = true;
            this.Enabled             = false;

            DualPrintDialog dlg = null;

            try
            {
                dlg = new DualPrintDialog(brlFileName);
            }
            finally
            {
                this.Enabled = true;
                m_BusyForm.Hide();
                m_BusyForm.Close();
            }

            try
            {
                // 一定要讓 main form 變成作用中視窗,否則預覽列印對話窗不會變成 top-level window!!
                this.Activate();
                dlg.PreviewText();
            }
            finally
            {
                this.Show();
                this.BringToFront();
                this.Activate();
            }
        }
Exemple #2
0
        private void DoPrint()
        {
            if (m_BrDoc.LineCount < 1)
            {
                MsgBoxHelper.ShowInfo("沒有資料可供列印!");
                return;
            }

            m_BrDoc.UpdateTitlesLineIndex();

            DualPrintDialog prnDlg = new DualPrintDialog(m_BrDoc);

            prnDlg.ShowDialog();
        }