From cbbd53eda55fbdf65f22b5f57c7dbc4b1ea594fd Mon Sep 17 00:00:00 2001 From: alexke-dev <65682333+alexke-dev@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:28:02 -0700 Subject: Remove Print Driver Samples (#1017) * Remove print driver samples. Add README.md to redirect consumers to Print Support App (PSA) development guide. * Remove en-us from URL. --- .../ExtensionSample/PrintSchemaHelper.cs | 190 --------------------- 1 file changed, 190 deletions(-) delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintSchemaHelper.cs (limited to 'print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintSchemaHelper.cs') diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintSchemaHelper.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintSchemaHelper.cs deleted file mode 100644 index e9201162..00000000 --- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintSchemaHelper.cs +++ /dev/null @@ -1,190 +0,0 @@ -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved -// -// -// Abstract: -// -// This file contains helper methods that provide a data-binding friendly way to access PrintSchema APIs. - -using System; -using System.Collections.Generic; -using System.Text; - -using System.Runtime.InteropServices; - -using Microsoft.Samples.Printing.PrinterExtension.Types; - -namespace Microsoft.Samples.Printing.PrinterExtension.Helpers -{ - /// - /// Contains helper methods that provide a data-binding friendly way to access PrintSchema APIs. - /// - public class PrintSchemaHelper - { - /// - /// Constructor. Warning constructing this object is expensive, and is best performed - /// asynchronously. - /// - /// The print ticket for which features/options will be retrieved - /// List of features requested - internal PrintSchemaHelper(IPrintSchemaTicket ticket, IEnumerable featureNameCollection) - { - _ticket = ticket; - _featureNameCollection = featureNameCollection; - _capabilities = _ticket.GetCapabilities(); - } - - /// - /// Retrieve the list of features from the current print ticket. - /// - public List Features - { - get - { - _featureHelperCollection = new List(); - - // - // Retrieve the list of features supported by the driver - // - - foreach (string name in _featureNameCollection) - { - // - // If the feature is not present in the print ticket or the print capabilities, - // ignore it and continue. - // - - IPrintSchemaFeature ticketFeature = _ticket.GetFeatureByKeyName(name); - if (ticketFeature == null) - { - continue; - } - - IPrintSchemaFeature capabilitiesFeature = _capabilities.GetFeatureByKeyName(name); - if (capabilitiesFeature == null) - { - continue; - } - - // If the feature is not meant to be displayed on the UI, ignore it and continue. - if (!capabilitiesFeature.DisplayUI) - { - continue; - } - - _featureHelperCollection.Add(new PrintSchemaFeatureHelper(ticketFeature, _capabilities, capabilitiesFeature)); - } - - return _featureHelperCollection; - } - } - - /// - /// List of features requested. - /// - private IEnumerable _featureNameCollection; - - /// - /// Helper objects that wrap an IPrintSchemaFeature object. - /// - private List _featureHelperCollection = null; - - /// - /// Print ticket passed into this class. - /// - private IPrintSchemaTicket _ticket = null; - - /// - /// Print capabilities object. - /// - private IPrintSchemaCapabilities _capabilities = null; - } - - /// - /// Contains helper methods that provide a data-binding friendly way to access IPrintSchemaFeature APIs. - /// - /// Note: This sample does not handle Print Ticket/Print Capabilities Options which rely on parameters to - /// be specified, such as psk:Custom , psk:CustomSquare, or psk:CustomMediaSize. If these options are - /// supported by compatible print drivers, then the printer extension should be modified to support them - /// appropriately. - /// - public class PrintSchemaFeatureHelper - { - /// - /// Constructor - /// - /// Object retrieved via a call to IPrintSchemaTicket::GetFeature/GetFeatureByKeyName - /// Print capabilities object - /// Object retrieved via a call to IPrintSchemaCapabilities::GetFeature/GetFeatureByKeyName - internal PrintSchemaFeatureHelper(IPrintSchemaFeature ticketFeature, IPrintSchemaCapabilities capabilities, IPrintSchemaFeature capabilitiesFeature) - { - // - // Populate the properties exposed by this class. - // - - DisplayName = capabilitiesFeature.DisplayName; - Options = new List(capabilities.GetOptions(ticketFeature)); - - foreach (IPrintSchemaOption option in Options) - { - if (option.Selected) - { - _selectedOption = option; - break; - } - } - - _printTicketFeature = ticketFeature; - } - - /// - /// Returns the display name for the current IPrintSchemaFeature object. - /// - public string DisplayName - { - get; - private set; - } - - /// - /// Retrieve the list of options supported for the current feature. - /// - public List Options - { - get; - private set; - } - - /// - /// A 'get' invocation on this property returns the selected option for this print ticket feature. - /// A 'set' invocation on this property sets the selected option for this print ticket feature. - /// - public IPrintSchemaOption SelectedOption - { - get - { - return _selectedOption; - } - set - { - _selectedOption = value; - _printTicketFeature.SelectedOption = _selectedOption; - } - } - - /// - /// Feature object retrieved from the print ticket. - /// - private IPrintSchemaFeature _printTicketFeature = null; - - /// - /// Selected option for the print ticket feature. - /// - private IPrintSchemaOption _selectedOption = null; - - } -} -- cgit v1.3.1