PrintTaskSourceRequestedArgs Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Arguments associated with the PrintTaskSourceRequestedHandler delegate. Provides a method for handing the content to be printed to the PrintTask.
public ref class PrintTaskSourceRequestedArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PrintTaskSourceRequestedArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PrintTaskSourceRequestedArgs
Public NotInheritable Class PrintTaskSourceRequestedArgs
- Inheritance
- Attributes
Device family |
Windows 10 (introduced in 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
PrintTaskSourceRequestedArgs is used to set the source of the content to be printed. Here is a code snippet from the UWP print sample that shows the SetSource method:
protected virtual void PrintTaskRequested(PrintManager sender, PrintTaskRequestedEventArgs e)
{
PrintTask printTask = null;
printTask = e.Request.CreatePrintTask("C# Printing SDK Sample", sourceRequested =>
{
// Print Task event handler is invoked when the print job is completed.
printTask.Completed += async (s, args) =>
{
// Notify the user when the print operation fails.
if (args.Completion == PrintTaskCompletion.Failed)
{
await scenarioPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
MainPage.Current.NotifyUser("Failed to print.", NotifyType.ErrorMessage);
});
}
};
// Call PrintTaskSourceRequestedArgs.SetSource
sourceRequested.SetSource(printDocumentSource);
});
}
For more information on this and other printing scenarios, see Printing and the UWP print sample.
Deadline |
Gets the DateTime object that indicates the deadline for a print task source request. |
Get |
Gets a PrintTaskSourceRequestedDeferral object that provides access to a Complete method. This method indicates then the deferral is over. |
Set |
Informs the print task of the content to be printed. |
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |