void OnPrintTaskCompleted(PrintTask sender, PrintTaskCompletedEventArgs args)
 {
     this.pageSize      = null;
     this.imageableRect = null;
     this.document      = null;
     this.pages         = null;
 }
 private async void PrintTaskCompleted(PrintTask sender, PrintTaskCompletedEventArgs args)
 {
     if (args.Completion == PrintTaskCompletion.Failed)
     {
         await Window.Current.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
         {
             ShowErrorMessage("Printing error", "Printing failed");
         });
     }
 }
示例#3
0
        private async void OnCompleted(PrintTask printTask, PrintTaskCompletedEventArgs e)
        {
            printTask.Completed -= OnCompleted;
            _images              = null;

            await DispatcherHelper.RunAsync(() =>
            {
                _manager.PrintTaskRequested -= OnPrintTaskRequested;
                _document?.Dispose();
            });
        }
示例#4
0
        private void HandlePrintTaskCompleted(PrintTask task, PrintTaskCompletedEventArgs args)
        {
            Debug.WriteLine("PrintTask Completed - {0}, Status = {1}.", task.Properties.Title, args.Completion);
            //args.Completion == PrintTaskCompletion.Submitted PrintTaskCompletion.Failed PrintTaskCompletion.Canceled  PrintTaskCompletion.Abandoned

            // Unsubscribe from the lifecycle events to prevent the task from being leaked
            task.Previewing  -= HandlePrintTaskPreviewing;
            task.Submitting  -= HandlePrintTaskSubmitting;
            task.Progressing -= HandlePrintTaskProgressing;
            task.Completed   -= HandlePrintTaskCompleted;
        }
 private async void PrintTaskCompleted(PrintTask sender, PrintTaskCompletedEventArgs args)
 {
     // Notify the user when the print operation fails.
     if (args.Completion == PrintTaskCompletion.Failed)
     {
         ContentDialog noPrintingDialog = new ContentDialog()
         {
             Title             = "ОШИБКА ПЕЧАТИ",
             Content           = "\nПЕЧАТЬ НЕ УДАЛАСЬ.",
             PrimaryButtonText = "OK"
         };
         await noPrintingDialog.ShowAsync();
     }
 }
示例#6
0
 private async void PrintTaskCompleted(PrintTask sender, PrintTaskCompletedEventArgs args)
 {
     // Notify the user when the print operation fails.
     if (args.Completion == PrintTaskCompletion.Failed)
     {
         await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => {
             ContentDialog noPrintingDialog = new ContentDialog()
             {
                 Title             = "Printing error",
                 Content           = "\nSorry, failed to print.",
                 PrimaryButtonText = "OK"
             };
             await noPrintingDialog.ShowAsync();
         });
     }
 }
 private void PrintTask_Completed(PrintTask sender, PrintTaskCompletedEventArgs args)
 {
     //恢复属性
     Invoke(() =>
     {
         newsPanel.Width  = double.NaN;
         newsPanel.Height = double.NaN;
         //newsPanel.Padding = new Thickness(40);
         htmlBlock.Width  = double.NaN;
         htmlBlock.Height = double.NaN;
         grid.Children.Remove(newsPanel);
         contentGrid.Children.Add(newsPanel);
         newsPanel.InvalidateMeasure();
         newsPanel.UpdateLayout();
         UpdateInlineUIElementsLayout(htmlBlock, new Size(htmlBlock.ActualWidth, htmlBlock.ActualHeight));
         newsPanel.InvalidateMeasure();
         newsPanel.UpdateLayout();
     });
 }
示例#8
0
 private void PrintTask_Completed(PrintTask sender, PrintTaskCompletedEventArgs args)
 {
     Debug.WriteLine("PrintTask_Completed");
 }
示例#9
0
 private void PrintTask_Completed(PrintTask sender, PrintTaskCompletedEventArgs args)
 {
 }