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/App.xaml | 7 -
.../ExtensionSample/App.xaml.cs | 146 -------
.../ExtensionSample/BidiHelper.cs | 154 -------
.../ExtensionSample/Fabrikam_Logo.png | Bin 2589 -> 0 bytes
.../ExtensionSample/PrintPreferenceWindow.xaml | 147 -------
.../ExtensionSample/PrintPreferenceWindow.xaml.cs | 467 ---------------------
.../ExtensionSample/PrintSchemaHelper.cs | 190 ---------
.../ExtensionSample/PrinterExtensionSample.csproj | 285 -------------
.../ExtensionSample/Properties/AssemblyInfo.cs | 62 ---
.../Properties/Resources.Designer.cs | 63 ---
.../ExtensionSample/Properties/Resources.resx | 117 ------
.../Properties/Settings.Designer.cs | 26 --
.../ExtensionSample/Properties/Settings.settings | 7 -
.../ExtensionSample/Strings.Designer.cs | 82 ----
.../ExtensionSample/Strings.resx | 129 ------
.../ExtensionSample/ValidationModalDialog.xaml | 19 -
.../ExtensionSample/ValidationModalDialog.xaml.cs | 108 -----
.../ExtensionSample/WindowHelper.cs | 83 ----
.../ExtensionSample/app.config | 9 -
.../ExtensionSample/bidi_Ink_mock.xml | 74 ----
20 files changed, 2175 deletions(-)
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintSchemaHelper.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrinterExtensionSample.csproj
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/AssemblyInfo.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.Designer.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.resx
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.Designer.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.settings
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.Designer.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.resx
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/WindowHelper.cs
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/app.config
delete mode 100644 print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/bidi_Ink_mock.xml
(limited to 'print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample')
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml
deleted file mode 100644
index f97fc473..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs
deleted file mode 100644
index d37585c4..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/App.xaml.cs
+++ /dev/null
@@ -1,146 +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 the entry point to the application.
-
-using System;
-using System.Windows;
-using System.Runtime;
-
-using Microsoft.Samples.Printing.PrinterExtension.Types;
-using Microsoft.Samples.Printing.PrinterExtension.Helpers;
-
-using System.Windows.Interop;
-
-namespace Microsoft.Samples.Printing.PrinterExtension
-{
- ///
- /// Interaction logic for App.xaml.
- ///
- public partial class App : Application
- {
- ///
- /// This is the event handler invoked on various driver events.
- ///
- ///
- ///
- private static void OnDriverEvent(object sender, PrinterExtensionEventArgs eventArgs)
- {
- //
- // Display the print preferences window.
- //
-
- if (eventArgs.ReasonId.Equals(PrinterExtensionReason.PrintPreferences))
- {
- PrintPreferenceWindow printPreferenceWindow = new PrintPreferenceWindow();
- printPreferenceWindow.Initialize(eventArgs);
-
- //
- // Set the caller application's window as parent/owner of the newly created printing preferences window.
- //
-
- WindowInteropHelper wih = new WindowInteropHelper(printPreferenceWindow);
- wih.Owner = eventArgs.WindowParent;
-
- //
- // Display a modal/non-modal window based on the 'WindowModal' parameter.
- //
-
- if (eventArgs.WindowModal)
- {
- printPreferenceWindow.ShowDialog();
- }
- else
- {
- printPreferenceWindow.Show();
-
- // Flash the window to draw the user's attention. This is required
- // because the printer extension may be drawn behind the parent window.
- // The return value of FlashWindow can be safely ignored if there is no need
- // to know if the window has focus or not.
- WindowHelper.FlashWindow(wih.Handle);
- }
- }
- else if (eventArgs.ReasonId.Equals(PrinterExtensionReason.DriverEvent))
- {
- //
- // Handle driver events here.
- //
- }
- }
-
- ///
- /// Perform initialization tasks for the printer extension in this event handler.
- ///
- ///
- ///
- private void Application_Startup(object sender, StartupEventArgs e)
- {
- //
- // It is recommended that exactly one instance of the PrinterExtensionManager be created per instance of
- // the printer extension.
- //
-
- if (manager != null)
- {
- return;
- }
- manager = new PrinterExtensionManager();
-
- //
- // Enable events to be received on one printer driver id.
- //
- // Note: The order of adding the delegate to PrinterExtensionManager.OnDriverEvent
- // and invoking PrinterExtensionManager::EnableEvents is important.
- // Adding the delegate should be done first.
- //
-
- manager.OnDriverEvent += OnDriverEvent;
-
- //
- // It is recommended that an instance of a printer extension invoke PrinterExtensionManager::EnableEvents
- // for exactly one printer driver id. The printer driver id could come in from a command line argument,
- // thereby allowing one application binary to dynamically invoke PrinterExtensionManager::EnableEvents against
- // the appropriate printer driver id.
- //
-
- manager.EnableEvents(Guid.Parse(PrinterDriverID));
- }
-
- ///
- /// Perform uninitialization tasks for the printer extension in this event handler.
- ///
- ///
- ///
- private void Application_Exit(object sender, ExitEventArgs e)
- {
- manager.OnDriverEvent -= OnDriverEvent;
- manager.DisableEvents();
-
- manager = null;
- }
-
- ///
- /// This is the printer driver id, as defined in the printer driver manifest file.
- /// Please replace this GUID with the printer driver id from your manifest file.
- ///
- /// It is recommended that you invoke PrinterExtensionManager::EnableEvents() on exactly
- /// one printer driver id. The id could come in from a command line argument, thereby enabling
- /// one application binary to work with multiple printer driver ids.
- ///
- private const string PrinterDriverID = "{E0691E8D-F7CC-456E-A7B5-D1FC19BA2279}";
-
- ///
- /// Instance of the PrinterExtensionManager. It is recommended that you have only instance
- /// of the PrinterExtensionManager per application instance.
- ///
- private static PrinterExtensionManager manager = null;
- }
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs
deleted file mode 100644
index c975ee7c..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/BidiHelper.cs
+++ /dev/null
@@ -1,154 +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 and parse bidi response data.
-
-using System;
-using System.Collections.Generic;
-using System.Windows.Media;
-using System.Xml;
-
-namespace Microsoft.Samples.Printing.PrinterExtension.Helpers
-{
- ///
- /// Provide a data-binding friendly way to access and parse bidi response data.
- ///
- public class BidiHelper
- {
- ///
- /// Parse the bidi response.
- ///
- /// Bidi response XML data.
- public BidiHelper(string bidiResponse)
- {
- BidiResponseParser parser = new BidiResponseParser(bidiResponse);
- InkLevelC = parser.GetInkLevel(Colors.Cyan);
- InkLevelM = parser.GetInkLevel(Colors.Magenta);
- InkLevelY = parser.GetInkLevel(Colors.Yellow);
- InkLevelK = parser.GetInkLevel(Colors.Black);
- }
-
- ///
- /// Get the Cyan ink level.
- ///
- public double InkLevelC
- {
- get;
- private set;
- }
-
- ///
- /// Get the Magenta ink level.
- ///
- public double InkLevelM
- {
- get;
- private set;
- }
-
- ///
- /// Get the Yellow ink level.
- ///
- public double InkLevelY
- {
- get;
- private set;
- }
-
- ///
- /// Get the Black ink level.
- ///
- public double InkLevelK
- {
- get;
- private set;
- }
- }
-
- ///
- /// This class parses bidi response xml data and provides wrapper methods that operate upon the xml.
- ///
- internal class BidiResponseParser
- {
- ///
- /// Parse the bidi response.
- ///
- /// Bidi response XML data.
- internal BidiResponseParser(string bidiResponse)
- {
- bidiData = new XmlDocument();
- bidiData.LoadXml(bidiResponse);
-
- namespaceManager = new XmlNamespaceManager(bidiData.NameTable);
- namespaceManager.AddNamespace("bidi", "http://schemas.microsoft.com/windows/2005/03/printing/bidi");
- }
-
- ///
- /// Get the ink level for a given color.
- ///
- /// Color
- /// Ink level percentage
- internal double GetInkLevel(Color color)
- {
- XmlElement root = bidiData.DocumentElement;
- XmlNode inkNode = root.SelectSingleNode(CreateInkXPathQuery(color), namespaceManager);
- return double.Parse(inkNode.FirstChild.Value) / 100;
- }
-
- ///
- /// Create an XPath query that retrieves the ink level from a standard bidi response.
- ///
- ///
- ///
- private static string CreateInkXPathQuery(Color color)
- {
- string colorName = null;
-
- if (color.Equals(Colors.Black))
- {
- colorName = "Black";
- }
- else if (color.Equals(Colors.Red))
- {
- colorName = "Red";
- }
- else if (color.Equals(Colors.Green))
- {
- colorName = "Green";
- }
- else if (color.Equals(Colors.Blue))
- {
- colorName = "Blue";
- }
- else if (color.Equals(Colors.Cyan))
- {
- colorName = "Cyan";
- }
- else if (color.Equals(Colors.Magenta))
- {
- colorName = "Magenta";
- }
- else if (color.Equals(Colors.Yellow))
- {
- colorName = "Yellow";
- }
- else
- {
- throw new ArgumentException("Unsupported color");
- }
-
- return "/bidi:Get/Query/Schema[@name='\\Printer.Consumables." + colorName + "Ink" + ":Level']/BIDI_INT";
- }
-
- private XmlDocument bidiData;
- private XmlNamespaceManager namespaceManager;
- }
-
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png
deleted file mode 100644
index 196cd5f6..00000000
Binary files a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Fabrikam_Logo.png and /dev/null differ
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml
deleted file mode 100644
index 924efc21..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml.cs
deleted file mode 100644
index a6266662..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrintPreferenceWindow.xaml.cs
+++ /dev/null
@@ -1,467 +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 as the interaction logic and data-binding code/sources for the WPF print preferences window.
-
-using System;
-using System.ComponentModel;
-using System.Collections.Generic;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Media;
-
-using System.Reflection;
-using System.IO;
-
-using System.Xml.Linq;
-
-using System.Runtime.InteropServices;
-
-using Microsoft.Samples.Printing.PrinterExtension.Types;
-using Microsoft.Samples.Printing.PrinterExtension.Helpers;
-
-namespace Microsoft.Samples.Printing.PrinterExtension
-{
- ///
- /// Interaction logic for PrintPreferenceWindow.xaml.
- ///
- public partial class PrintPreferenceWindow : Window, INotifyPropertyChanged
- {
- public PrintPreferenceWindow()
- {
- InitializeComponent();
- }
-
- ///
- /// This method sets up data binding sources and performs other initialization tasks.
- ///
- ///
- public void Initialize(PrinterExtensionEventArgs eventArgs)
- {
- //
- // Populate the data binding sources.
- //
-
- DataContext = this;
-
- printerExtensionEventArgs = eventArgs;
- PrinterQueue = eventArgs.Queue;
- displayedPrintTicket = eventArgs.Ticket;
-
- //
- // Send a bidi query requesting ink levels.
- //
- // Please note: As this event will fire many times, it is recommended to maintain event
- // listeners for the life time of the application. Furthermore, the relationship to this
- // being invoked and the calling SendBidiQuery() is not 1:1; in fact, it is *:N, where the
- // listener may be called several times with bidi updates.
- //
- //
-
- PrinterQueue.OnBidiResponseReceived += OnBidiResponseReceived;
- PrinterQueue.SendBidiQuery("\\Printer.consumables");
- }
-
- #region UI code
-
- ///
- /// This event handler is invoked when the window is closing. It is important to Cancel or Complete the request when the window is closing.
- ///
- ///
- ///
- void PrintPreferenceWindow_Closing(object sender, EventArgs e)
- {
- // Since we are a different process from the printing application we need to hand focus back when complete.
- WindowHelper.SetForegroundWindow(printerExtensionEventArgs.WindowParent);
-
- if (!requestCompleted)
- {
- printerExtensionEventArgs.Request.Cancel((int)HRESULT.S_FALSE, "The user canceled the operation.");
- requestCompleted = true;
- }
- }
-
- ///
- /// Button click event handler.
- ///
- ///
- ///
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- Button clickedButton = (Button)sender;
-
- switch (clickedButton.Name)
- {
- case "CancelButton":
- CancelRequestAndCloseWindow();
- break;
-
- case "OkButton":
- //
- // Validate the print ticket asynchronously. The event handler is invoked when the validation is completed.
- //
-
- IPrintSchemaAsyncOperation asyncOperation = displayedPrintTicket.ValidateAsync();
-
- //
- // Pop up a modal dialog that prevents the user from changing selections when validation is in progress.
- // Since this dialog lives as long as the parent window, it is not mandatory to unregister the delegate for the
- // 'Completed' event.
- //
-
- ValidationModalDialog.Completed += PrintTicketValidateCompleted; // This operation is idempotent.
- ValidationModalDialog.StartAsyncOperation(asyncOperation);
- break;
-
- case "VerifyButton":
- //
- // Force WPF Data binding to refresh the UI. This operation retrieves
- // a fresh print capabilities for the print ticket based on the user selections.
- //
-
- PropertyChanged(this, new PropertyChangedEventArgs("PrintSchemaHelperSource"));
- break;
- }
- }
-
- ///
- /// Close the window in a thread-safe way.
- ///
- private void CloseWindow()
- {
- this.Dispatcher.BeginInvoke(new Action(() =>
- {
- this.Close();
- }));
- }
-
- #endregion
-
-
- #region Data binding sources
-
- ///
- /// The Print queue for which this window is being displayed.
- ///
- public IPrinterQueue PrinterQueue { get; private set; }
-
- ///
- /// The title for the ink status display.
- ///
- public string InkStatusTitle { get; private set; }
-
- ///
- /// Retrieve a new instance of PrintSchemaHelper, based on the current print ticket being displayed.
- /// PrintSchemaHelper encapsulates all the features and options required to populate the print preferences UI.
- ///
- public PrintSchemaHelper PrintSchemaHelperSource
- {
- get
- {
- //
- // Below is the list of features that will be displayed in the print preferences window.
- // The features are declared here for convenience/readability.
- //
- // In performant code, this array would be allocated only once per run of the application.
- //
-
- string[] featureNames = {
- "DocumentNUp",
- "PageMediaSize",
- "DocumentInputBin",
- "PageOrientation",
- "PageMediaType",
- "PageBorderless",
- "JobInputBin",
- "PageOutputColor",
- "DocumentCollate",
- "DocumentDuplex"
- };
-
- return new PrintSchemaHelper(displayedPrintTicket, featureNames);
- }
- }
-
- ///
- /// Encapsulates the information required to populate ink level.
- ///
- public BidiHelper BidiHelperSource { get; private set; }
-
- ///
- /// This event is raised when a data from a binding source is modified.
- ///
- public event PropertyChangedEventHandler PropertyChanged;
-
- #endregion
-
- #region Ink level display
- ///
- /// This is the method invoked when a bidi response is received.
- ///
- /// IPrinterQueue object.
- /// The results of the bidi response.
- private void OnBidiResponseReceived(object sender, PrinterQueueEventArgs e)
- {
- if (e.StatusHResult != (int)HRESULT.S_OK)
- {
- MockInkStatus();
- return;
- }
-
- //
- // Display the ink levels from the mock data.
- //
-
- BidiHelperSource = new BidiHelper(e.Response);
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs("BidiHelperSource"));
- }
- InkStatusTitle = "Ink status (Live data)";
- }
-
- ///
- /// This method is invoked when there is an error retrieving Bidi information.
- /// A mock bidi response is loaded from resource and displayed.
- ///
- private void MockInkStatus()
- {
- //
- // Load mock bidi response resource.
- //
-
- Assembly a = Assembly.GetExecutingAssembly();
- Stream xmlData = a.GetManifestResourceStream("PrinterExtensionSample.bidi_Ink_mock.xml");
- StreamReader sr = new StreamReader(xmlData);
- string xmlString = sr.ReadToEnd();
-
- //
- // Display the ink levels from the mock data.
- //
-
- BidiHelperSource = new BidiHelper(xmlString);
- if (PropertyChanged != null)
- {
- PropertyChanged(this, new PropertyChangedEventArgs("BidiHelperSource"));
- }
- InkStatusTitle = "Ink status (Mocked data)";
- }
- #endregion
-
- #region PrintSchema-related code
- ///
- /// Cancel the current printer extension event and close the current window.
- ///
- private void CancelRequestAndCloseWindow()
- {
- printerExtensionEventArgs.Request.Cancel((int)HRESULT.S_FALSE, "User canceled the operation");
- requestCompleted = true;
- CloseWindow();
- }
-
- ///
- /// Invoked when asynchronous print ticket validation is complete.
- ///
- ///
- ///
- 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);
- }));
- }
- }
-
- ///
- /// Invoked when there are constraints in the print ticket selections.
- ///
- ///
- private void HandleTicketConstraints(IPrintSchemaTicket validatedTicket)
- {
- //
- // Retrieved localized display strings from a resource file/
- //
- string selectionConflictsFound = PrinterExtensionSample.Strings.SelectionConflictsFound;
- string selectionConflictsTitle = PrinterExtensionSample.Strings.SelectionConflictsTitle;
-
- MessageBoxResult result = MessageBox.Show(
- this,
- selectionConflictsFound,
- selectionConflictsTitle,
- MessageBoxButton.YesNoCancel);
-
- if (result == MessageBoxResult.Yes)
- {
- CommitPrintTicketAsync(validatedTicket);
- }
- else
- {
- PropertyChanged(this, new PropertyChangedEventArgs("PrintSchemaHelperSource"));
- }
- }
-
- ///
- /// Commits the input print ticket asynchronously. The completed event handler is expected to close the window.
- ///
- ///
- private void CommitPrintTicketAsync(IPrintSchemaTicket validatedTicket)
- {
- IPrintSchemaAsyncOperation commitAsyncOperation = printerExtensionEventArgs.Ticket.CommitAsync(validatedTicket);
- commitAsyncOperation.Completed += PrintTicketCommitCompleted;
- commitAsyncOperation.Start();
- }
-
- ///
- /// Invoked when the user's selections have been committed into the print ticket.
- ///
- ///
- ///
- private void PrintTicketCommitCompleted(object sender, PrintSchemaAsyncOperationEventArgs e)
- {
- CompleteRequestAndCloseWindow();
- }
-
- ///
- /// Complete the current printer extension request and close the current window.
- ///
- private void CompleteRequestAndCloseWindow()
- {
- //
- // It is important to invoke the IPrinterExtensionRequest::Complete method from the thread the
- // class instance was create on (i.e. the UI thread).
- //
-
- this.Dispatcher.Invoke(new Action(() =>
- {
- printerExtensionEventArgs.Request.Complete();
- }));
-
- requestCompleted = true;
- CloseWindow();
- }
-
- ///
- /// Demonstrates how to modify print ticket XML. This piece of code does not perform any functionality.
- /// It serves to demonstrate the usage of IPrintSchemaTicket::GetReadStream()/GetWriteStream()
- ///
- private void ModifyPrintTicketXml()
- {
- //
- // Load the ticket XML (as a Stream) into an XElement object.
- //
-
- XElement ticketRootXElement = null;
- using (Stream ticketReadStream = displayedPrintTicket.GetReadStream())
- {
- ticketRootXElement = XElement.Load(ticketReadStream);
- }
-
- //
- // Perform any modifications on the XElement object.
- //
-
-
- //
- // Write the changes back to the print ticket.
- //
- using (Stream ticketWriteStream = displayedPrintTicket.GetWriteStream())
- {
- ticketRootXElement.Save(ticketWriteStream);
- }
- }
-
- #endregion
-
- ///
- /// The arguments passed in for this print preferences event.
- ///
- private PrinterExtensionEventArgs printerExtensionEventArgs = null;
-
- ///
- /// Reflects the currently displayed print preference options.
- ///
- private IPrintSchemaTicket displayedPrintTicket = null;
-
- ///
- /// Determines if IPrinterExtensionRequest::Complete()/Cancel() has been invoked for this Window.
- /// instance
- ///
- private bool requestCompleted = false;
- }
-
- ///
- /// This class transforms the boolean 'IPrintSchemaOption.Constrained' into a visual form.
- ///
- public class OptionConstrainedToDisplayColorConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value == null)
- {
- return "Black";
- }
-
- //
- // If the option is not constrained, it will be diplayed in black.
- //
-
- PrintSchemaConstrainedSetting constrained = (PrintSchemaConstrainedSetting)value;
- if (constrained == PrintSchemaConstrainedSetting.None)
- {
- return "Black";
- }
-
- //
- // If the option is constrained, it will be displayed in red.
- //
-
- return "Red";
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-
- ///
- /// Provides a friendlier way to use HRESULT error codes.
- ///
- enum HRESULT : int
- {
- S_OK = 0x0000,
- S_FALSE = 0x0001,
- S_PT_NO_CONFLICT = 0x40001,
- E_INVALIDARG = unchecked((int)0x80070057),
- E_OUTOFMEMORY = unchecked((int)0x8007000E),
- ERROR_NOT_FOUND = unchecked((int)0x80070490)
- }
-}
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;
-
- }
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrinterExtensionSample.csproj b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrinterExtensionSample.csproj
deleted file mode 100644
index 293ca0e4..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/PrinterExtensionSample.csproj
+++ /dev/null
@@ -1,285 +0,0 @@
-
-
-
- Debug
- x86
- 8.0.30703
- 2.0
- {CF554A99-6889-4B86-934F-B6AADBFEFC01}
- WinExe
- Properties
- PrinterExtensionSample
- PrinterExtensionSample
- v4.0
-
-
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
-
-
- bin\Win8 Debug\
- DEBUG;TRACE
- x86
- true
- full
- false
- prompt
- 4
- false
-
-
- bin\Win8 Release\
- TRACE
- x86
- true
- pdbonly
- true
- prompt
- 4
- false
-
-
- bin\x64\Win8 Debug\
- DEBUG;TRACE
- x64
- true
- full
- false
- prompt
- 4
- false
-
-
- bin\x64\Win8 Release\
- TRACE
- x64
- true
- pdbonly
- true
- prompt
- 4
- false
-
-
- bin\Win8.1 Debug\
- DEBUG;TRACE
- x86
- true
- full
- false
- prompt
- 4
- false
-
-
- bin\Win8.1 Release\
- TRACE
- x86
- true
- pdbonly
- true
- prompt
- 4
- false
-
-
- bin\x64\Win8.1 Debug\
- DEBUG;TRACE
- x64
- true
- full
- false
- prompt
- 4
- false
-
-
- bin\x64\Win8.1 Release\
- TRACE
- x64
- true
- pdbonly
- true
- prompt
- 4
- false
-
-
- bin\Win10 Debug\
- DEBUG;TRACE
- x86
- true
- full
- false
- prompt
- 4
- false
-
-
- bin\Win10 Release\
- TRACE
- x86
- true
- pdbonly
- true
- prompt
- 4
- false
-
-
- bin\x64\Win10 Debug\
- DEBUG;TRACE
- x64
- true
- full
- false
- prompt
- 4
- false
-
-
- bin\x64\Win10 Release\
- TRACE
- x64
- true
- pdbonly
- true
- prompt
- 4
- false
-
-
- bin\ARM64\Win10 Debug\
- DEBUG;TRACE
- ARM64
- true
- full
- false
- prompt
- 4
- false
-
-
- bin\ARM64\Win10 Release\
- TRACE
- ARM64
- true
- pdbonly
- true
- prompt
- 4
- false
-
-
-
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
-
- True
- True
- Strings.resx
-
-
- ValidationModalDialog.xaml
-
-
- MSBuild:Compile
- Designer
-
-
-
- MSBuild:Compile
- Designer
-
-
- App.xaml
- Code
-
-
- PrintPreferenceWindow.xaml
- Code
-
-
- MSBuild:Compile
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
- ResXFileCodeGenerator
- Strings.Designer.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
-
- {d8da0c4d-f972-4546-9068-8eb256f222f7}
- PrinterExtensionLibrary
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/AssemblyInfo.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/AssemblyInfo.cs
deleted file mode 100644
index c3198284..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,62 +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
-//
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("PrinterExtensionSample")]
-[assembly: AssemblyDescription("Printer Extension Sample for v4 print drivers")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("PrinterExtensionSample")]
-[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//CultureYouAreCodingWith in your .csproj file
-//inside a . For example, if you are using US english
-//in your source files, set the to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.Designer.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.Designer.cs
deleted file mode 100644
index b6af3bc4..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.17325
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace PrinterExtensionSample.Properties {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PrinterExtensionSample.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.resx b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.resx
deleted file mode 100644
index af7dbebb..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.Designer.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.Designer.cs
deleted file mode 100644
index c0a373ef..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.17325
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace PrinterExtensionSample.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.settings b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.settings
deleted file mode 100644
index 033d7a5e..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.Designer.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.Designer.cs
deleted file mode 100644
index 6ea88a35..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.Designer.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.17361
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace PrinterExtensionSample {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Strings {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Strings() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PrinterExtensionSample.Strings", typeof(Strings).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to Selection conflicts were encountered.
- ///Would you like them auto-resolved?.
- ///
- internal static string SelectionConflictsFound {
- get {
- return ResourceManager.GetString("SelectionConflictsFound", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Selection conflicts.
- ///
- internal static string SelectionConflictsTitle {
- get {
- return ResourceManager.GetString("SelectionConflictsTitle", resourceCulture);
- }
- }
- }
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.resx b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.resx
deleted file mode 100644
index 8f4878a4..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/Strings.resx
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Selection conflicts were encountered.
-Would you like them auto-resolved?
- String to display in the message box when print ticket settings have conflicts.
-
-
- Selection conflicts
- Title string on the message box that displays the selection conflicts message.
-
-
\ No newline at end of file
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml
deleted file mode 100644
index c949efd4..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
- Validating.. please wait
-
-
-
-
-
-
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml.cs
deleted file mode 100644
index 0728c84c..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/ValidationModalDialog.xaml.cs
+++ /dev/null
@@ -1,108 +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 as the interaction logic for ValidationModaldialog.
-// This dialog prevents the user from making changes to print ticket settings when asynchronous
-// validation is being performed.
-
-using System;
-using System.Collections.Generic;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-
-using Microsoft.Samples.Printing.PrinterExtension.Types;
-
-namespace Microsoft.Samples.Printing.PrinterExtension
-{
- ///
- /// Interaction logic for ValidationModalDialog.xaml
- /// This dialog prevents the user from changing print preferences when validation is in progress.
- ///
- public partial class ValidationModalDialog : UserControl
- {
- public ValidationModalDialog()
- {
- InitializeComponent();
- Visibility = Visibility.Hidden;
- }
-
- ///
- /// Starts the asynchronous operation.
- ///
- /// Async operation context.
- public void StartAsyncOperation(IPrintSchemaAsyncOperation asyncOperationToStart)
- {
- this.asyncOperationContext = asyncOperationToStart;
- Visibility = Visibility.Visible;
- asyncOperationToStart.Completed += asyncOperation_Completed;
- asyncOperationToStart.Start();
- }
-
-
- ///
- /// This method is invoked from a different thread once asynchronous validation is completed.
- ///
- ///
- ///
- private void asyncOperation_Completed(object sender, PrintSchemaAsyncOperationEventArgs e)
- {
- ValidationHResult = e.StatusHResult;
- HideWindow();
-
- if (Completed != null)
- {
- Completed(this, e);
- }
- }
-
- ///
- /// Hides the current window.
- ///
- private void HideWindow()
- {
- this.Dispatcher.Invoke(new Action(() =>
- {
- Visibility = Visibility.Hidden;
- }));
- }
-
-
- ///
- /// Result of the validation operation.
- ///
- public int ValidationHResult
- {
- get;
- private set;
- }
-
- ///
- /// Invoked then the "Cancel" button is clicked.
- ///
- ///
- ///
- private void CancelValidationButton_Click(object sender, RoutedEventArgs e)
- {
- asyncOperationContext.Cancel();
- HideWindow();
- }
-
- ///
- /// Invoked when the asynchronous operation is completed.
- ///
- public event EventHandler Completed;
-
- ///
- /// Asynchronous operation context.
- ///
- private IPrintSchemaAsyncOperation asyncOperationContext;
- }
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/WindowHelper.cs b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/WindowHelper.cs
deleted file mode 100644
index fe830921..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/WindowHelper.cs
+++ /dev/null
@@ -1,83 +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 friendly way to access win32 window functions.
-
-using System;
-using System.Runtime.InteropServices;
-
-namespace Microsoft.Samples.Printing.PrinterExtension.Helpers
-{
- class WindowHelper
- {
- ///
- /// P/Invoke signature for Win32 function "SetForegroundWindow".
- ///
- /// Handle to window
- [return: MarshalAs(UnmanagedType.Bool)]
- [DllImport("User32", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
- public static extern bool SetForegroundWindow(IntPtr hwnd);
-
- ///
- /// Wrapper for Win32 function "FlashWindowEx"
- ///
- /// Handle of the window to flash
- public static bool FlashWindow(IntPtr hWnd)
- {
- FLASHWINFO fInfo = new FLASHWINFO();
-
- fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
- fInfo.hwnd = hWnd; // Handle to window
- fInfo.uCount = UInt32.MaxValue; // Number of times to flash
- fInfo.dwTimeout = 0; // Use default cursor blink rate
- // Flash both window caption and taskbar button, until the window is brought to the foreground.
- fInfo.dwFlags = (uint)(FLASHW.ALL | FLASHW.TIMERNOFG);
-
- return FlashWindowEx(ref fInfo);
- }
-
- #region private members
-
- ///
- /// P/Invoke signature for Win32 function "FlashWindowEx".
- ///
- [return: MarshalAs(UnmanagedType.Bool)]
- [DllImport("User32", CharSet = CharSet.Auto, SetLastError = false, ExactSpelling = true)]
- private static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
-
- [StructLayout(LayoutKind.Sequential)]
- private struct FLASHWINFO
- {
- public UInt32 cbSize;
- public IntPtr hwnd;
- public UInt32 dwFlags;
- public UInt32 uCount;
- public UInt32 dwTimeout;
- }
-
- ///
- /// Represents the FLASH_Xxx flags
- ///
- [Flags]
- private enum FLASHW : uint
- {
- ///
- /// Flash both the window caption and taskbar button
- ///
- ALL = 3,
- ///
- /// Flash continuously until the window comes to the foreground.
- ///
- TIMERNOFG = 12
- }
-
- #endregion
- }
-}
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/app.config b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/app.config
deleted file mode 100644
index bfc57c55..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/app.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/bidi_Ink_mock.xml b/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/bidi_Ink_mock.xml
deleted file mode 100644
index b1a685f1..00000000
--- a/print/v4PrintDriverSamples/PrinterExtensionSample/ExtensionSample/bidi_Ink_mock.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
- Black
-
-
- true
-
-
- 86
-
-
- InkSupply
-
-
- Cyan
-
-
- true
-
-
- 79
-
-
- InkSupply
-
-
- LightBlack
-
-
- true
-
-
- 0
-
-
- InkSupply
-
-
- Magenta
-
-
- true
-
-
- 79
-
-
- InkSupply
-
-
- true
-
-
- -1
-
-
- PrintHead
-
-
- Yellow
-
-
- true
-
-
- 87
-
-
- InkSupply
-
-
-
--
cgit v1.3.1