/// <summary> /// Invoked when asynchronous print ticket validation is complete. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PrintTicketValidateCompleted(object sender, PrintSchemaAsyncOperationEventArgs e) { // // Print ticket validation completed successfully i.e. print ticket selections are not constrained. // The print ticket needs to be committed, and then window can be closed. // if (e.StatusHResult == (int)HRESULT.S_PT_NO_CONFLICT) { this.Dispatcher.Invoke(new Action(() => { CommitPrintTicketAsync(e.Ticket); })); } else { // // The ticket selections are constrained. // this.Dispatcher.Invoke(new Action(() => { HandleTicketConstraints(e.Ticket); })); } }
/// <summary> /// This method is invoked from a different thread once asynchronous validation is completed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void asyncOperation_Completed(object sender, PrintSchemaAsyncOperationEventArgs e) { ValidationHResult = e.StatusHResult; HideWindow(); if (Completed != null) { Completed(this, e); } }
/// <summary> /// Invoked when the user's selections have been committed into the print ticket. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PrintTicketCommitCompleted(object sender, PrintSchemaAsyncOperationEventArgs e) { CompleteRequestAndCloseWindow(); }