/// <summary>
 /// Called when WritingCompleted event raised by a DocumentWriter (during printing).
 /// </summary>
 /// <param name="sender">Sender of the event.</param>
 /// <param name="e">Event arguments.</param>
 private void HandlePrintCompleted(object sender, WritingCompletedEventArgs e)
 {
     CleanUpPrintOperation();
 }
Beispiel #2
0
        /* Done */
        private void AsyncCompleted(object sender, WritingCompletedEventArgs e)
        {
            PrintStatus_t status;

            if (e.Cancelled)
                status = PrintStatus_t.PRINT_CANCELLED;
            else if (e.Error != null)
                status = PrintStatus_t.PRINT_ERROR;
            else
                status = PrintStatus_t.PRINT_READY;

            if (PrintUpdate != null)
            {
                gsPrintEventArgs info = new gsPrintEventArgs(status, true, 0);
                PrintUpdate(this, info);
            }
            m_busy = false;
        }
Beispiel #3
0
 /* Done */
 private void AsyncCompleted(object sender, WritingCompletedEventArgs e)
 {
     if (e.Cancelled)
         m_pparams.result = PrintResult_t.PrintCANCELLED;
     else if (e.Error != null)
         m_pparams.result = PrintResult_t.PrintFAILED;
     else
         m_pparams.result = PrintResult_t.PrintCOMPLETED;
     m_worker.ReportProgress(100);
 }
 /// <summary>
 /// Called when WritingCompleted event raised by a DocumentWriter (during printing).
 /// </summary>
 /// <param name="sender">Sender of the event.</param>
 /// <param name="e">Event arguments.</param>
 private void HandlePrintCompleted(object sender, WritingCompletedEventArgs e)
 {
     OnPrintCompleted();
 }
Beispiel #5
0
        private void PrintAsync_Completed(object sender,
            WritingCompletedEventArgs e)
        {
            string message;
            MessageBoxImage messageBoxImage;

            //Check to see if there was a problem with the printing.
            if (e.Error != null)
            {
                messageBoxImage = MessageBoxImage.Error;
                message =
                    string.Format("An error occurred whilst printing.\n\n{0}",
                                  e.Error.Message);
            }
            else if (e.Cancelled)
            {
                messageBoxImage = MessageBoxImage.Stop;
                message = "Printing was cancelled by the user.";
            }
            else
            {
                messageBoxImage = MessageBoxImage.Information;
                message = "Printing completed successfully.";
            }

            MessageBox.Show(message, "Recipe_07_07",
                            MessageBoxButton.OK, messageBoxImage);

            StopLongPrintingOperation();
        }
 // Handles writing complete
 private void OnWritingComplete(object sender, WritingCompletedEventArgs e)
 {
     // removes indication
     PrintingContent = null;
     PrintingPercentage = null;
     if (e.Error != null) MessageBox.Show(e.Error.Message);
 }
Beispiel #7
0
        // ------------------------ AsyncPrintCompleted -----------------------
        /// <summary>
        ///   Creates an "async operation complete" event handler
        ///   for print completion of a FixedDocumentSequence.</summary>
        private void AsyncPrintCompleted(
            object sender, WritingCompletedEventArgs e)
        {
            string result = null;
            if (e.Cancelled)
                result = "Canceled";
            else if (e.Error != null)
                result = "Error";
            else
                result = "Asynchronous Print Completed";

            if (OnAsyncPrintChange != null)
            {
                AsyncPrintEventArgs asyncInfo =
                    new AsyncPrintEventArgs(result, true);
                OnAsyncPrintChange(this, asyncInfo);  // update display status
            }
        }