예제 #1
0
        static void PrintTaskSourceRequested(PrintTaskSourceRequestedArgs args)
        {
            IPrintDocumentSource source = null;

            // TODO How do we get from our text file to an IPrintDocumentSource???

            args.SetSource(source);
        }
    async void OnPrintTaskSourceRequested(PrintTaskSourceRequestedArgs args)
    {
        var def = args.GetDeferral();
        await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
        {
            args.SetSource(printDoc.DocumentSource);
        });

        def.Complete();
    }
예제 #3
0
        private async void OnPrintTaskSourceRequrested(PrintTaskSourceRequestedArgs args)
        {
            var def = args.GetDeferral();
            await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
                                      () =>
            {
                args.SetSource(printDoc?.DocumentSource);
            });

            def.Complete();
        }
예제 #4
0
        private void HandlePrintTaskSourceRequested
            (PrintTaskSourceRequestedArgs args)
        {
            // Called when a printer is selected from the printers list panel
            Debug.WriteLine("PrintTask Source Requested");

            // Request a deferral to accommodate the async operation
            var deferral = args.GetDeferral();

            // Set the document source for the current print job.
            // This MUST happen on the UI thread.
            _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                args.SetSource(_printDocument.DocumentSource);

                // Complete the deferral to indicate completion
                deferral.Complete();
            });
        }
예제 #5
0
        async void OnPrintTaskSourceRequestedHandler(PrintTaskSourceRequestedArgs args)
        {
            var deferral = args.GetDeferral();

            await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                           () =>
            {
                this.document = new PrintDocument();

                this.document.Paginate       += OnPaginate;
                this.document.GetPreviewPage += OnGetPreviewPage;
                this.document.AddPages       += OnAddPages;

                args.SetSource(this.document.DocumentSource);
            }
                                           );

            deferral.Complete();
        }
예제 #6
0
 private void OnPrintTaskSourceRequested(PrintTaskSourceRequestedArgs args)
 {
     args.SetSource(_documentSource);
 }
예제 #7
0
 private void PrintTaskSourceRequrested(PrintTaskSourceRequestedArgs args)
 {
     // Set the document source.
     args.SetSource(printDocSource);
 }
 void OnPrintTaskSourceRequested(PrintTaskSourceRequestedArgs args)
 {
     args.SetSource(printDocumentSource);
 }
예제 #9
0
 private void PrintTaskSourceRequested(PrintTaskSourceRequestedArgs args)
 {
     Debug.WriteLine("PrintTaskSourceRequested");
     args.SetSource(printDocumentSource);
 }
예제 #10
0
 private void OnPrintTaskSourceRequested(PrintTaskSourceRequestedArgs e)
 {
     e.SetSource(_document?.Source);
 }
예제 #11
0
 private static void PrintTaskSourceRequrested(PrintTaskSourceRequestedArgs args)
 {
     args.SetSource(printDocSource);
 }