public UserPreferences(YellowstonePathology.Business.User.UserPreference userPreference)
        {
            this.m_UserPreferenceList             = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetAllUserPreferences();
            this.m_MolecularLabelFormatCollection = YellowstonePathology.Business.Label.Model.LabelFormatCollection.GetMolecularLabelCollection();
            this.m_CassettePrinterCollection      = new Business.Label.Model.CassettePrinterCollection();
            this.m_FacilityCollection             = Business.Facility.Model.FacilityCollection.Instance;

            System.Printing.LocalPrintServer printServer = new System.Printing.LocalPrintServer();
            this.m_PrintQueueCollection = printServer.GetPrintQueues(new[] { System.Printing.EnumeratedPrintQueueTypes.Local, System.Printing.EnumeratedPrintQueueTypes.Connections });

            this.m_ApplicationVersion = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.GetApplicationVersion(this);

            InitializeComponent();

            if (userPreference == null)
            {
                this.m_UserPreference  = new Business.User.UserPreference();
                this.m_HostNameEnabled = true;
            }
            else
            {
                this.m_UserPreference  = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullUserPreference(userPreference.HostName, this);
                this.m_HostNameEnabled = false;
            }

            this.m_PageScannerCollection = new Business.Common.PageScannerCollection();
            this.DataContext             = this;
            this.Loaded  += new RoutedEventHandler(UserPreferences_Loaded);
            this.Closing += UserPreferences_Closing;
        }
        public SettingsDialog()
        {
            System.Printing.LocalPrintServer printServer = new System.Printing.LocalPrintServer();
            this.m_PrintQueueCollection = printServer.GetPrintQueues(new[] { System.Printing.EnumeratedPrintQueueTypes.Local, System.Printing.EnumeratedPrintQueueTypes.Connections });

            InitializeComponent();
            this.DataContext = this;

            if (LocalSettings.AreLocalSettingsConfigured() == true)
            {
                this.m_LocalSettings              = LocalSettings.Instance;
                this.m_FormPropertiesAreEnabled   = true;
                this.PasswordBoxPassword.Password = this.m_LocalSettings.Password;

                if (string.IsNullOrEmpty(this.m_LocalSettings.QRCodeImage) == false)
                {
                    this.LoadQRCodeImage(this.m_LocalSettings.QRCodeImage);
                }
            }
            else
            {
                this.m_FormPropertiesAreEnabled = false;
            }

            this.NotifyPropertyChanged(string.Empty);
        }
Exemple #3
0
 public LabelPrinter(string printQueueName)
 {
     this.m_X     = 0;
     this.m_Y     = 0;
     this.m_Queue = new Queue <Label>();
     System.Printing.PrintServer          localPrintServer     = new System.Printing.PrintServer();
     System.Printing.PrintQueueCollection printQueueCollection = localPrintServer.GetPrintQueues(new[] { System.Printing.EnumeratedPrintQueueTypes.Local, System.Printing.EnumeratedPrintQueueTypes.Connections });
     foreach (System.Printing.PrintQueue printQueue in printQueueCollection)
     {
         if (printQueue.Name == printQueueName)
         {
             this.m_PrintQueue         = printQueue;
             this.m_HostingPrintServer = printQueue.HostingPrintServer;
         }
     }
 }
        public UserPreferences()
        {
            this.m_MolecularLabelFormatCollection = YellowstonePathology.Business.Label.Model.LabelFormatCollection.GetMolecularLabelCollection();
            this.m_UserPreference = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference;

            this.m_FacilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
            this.m_LocationCollection = new Business.Facility.Model.LocationCollection();

            System.Printing.LocalPrintServer printServer = new System.Printing.LocalPrintServer();
            this.m_PrintQueueCollection = printServer.GetPrintQueues(new[] { System.Printing.EnumeratedPrintQueueTypes.Local, System.Printing.EnumeratedPrintQueueTypes.Connections });

            this.m_ApplicationVersion = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.GetApplicationVersion(this);

            InitializeComponent();

            this.DataContext = this;
            this.Loaded += new RoutedEventHandler(UserPreferences_Loaded);
            this.Closing += UserPreferences_Closing;
        }
Exemple #5
0
        static void PdfPrintingTest()
        {
            PdfSharp.Pdf.PdfDocument pdfDocument = PdfSharp.Pdf.IO.PdfReader.Open(@"C:\MERCURY\BHPP_Flyer_5_10.pdf", PdfSharp.Pdf.IO.PdfDocumentOpenMode.ReadOnly);



            System.Printing.LocalPrintServer printServer = new System.Printing.LocalPrintServer();

            // System.Printing.PrintServer printServer = new System.Printing.PrintServer (@"\\qsdc001");

            System.Printing.PrintQueueCollection printQueues = printServer.GetPrintQueues();

            foreach (System.Printing.PrintQueue currentPrintQueue in printQueues)
            {
                System.Diagnostics.Debug.WriteLine(currentPrintQueue.Name);
            }



            System.Diagnostics.Process acrobatProcess = new System.Diagnostics.Process();

            acrobatProcess.StartInfo.FileName = @"C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe";

            acrobatProcess.Start();

            // System.Threading.Thread.Sleep (5000);


            PdfSharp.Pdf.Printing.PdfFilePrinter.AdobeReaderPath = @"C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe";

            PdfSharp.Pdf.Printing.PdfFilePrinter pdfPrinter = new PdfSharp.Pdf.Printing.PdfFilePrinter();

            pdfPrinter.PrinterName = @"Microsoft XPS Document Writer";

            pdfPrinter.PdfFileName = @"C:\MERCURY\BHPP_Flyer_5_10.pdf";

            pdfPrinter.WorkingDirectory = @"C:\MERCURY\";

            pdfPrinter.Print();

            // acrobatProcess.CloseMainWindow ();
        }
        public UserPreferences()
        {
            this.m_MolecularLabelFormatCollection = YellowstonePathology.Business.Label.Model.LabelFormatCollection.GetMolecularLabelCollection();
            this.m_UserPreference = YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference;

            this.m_FacilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
            this.m_LocationCollection = new Business.Facility.Model.LocationCollection();

            System.Printing.LocalPrintServer printServer = new System.Printing.LocalPrintServer();
            this.m_PrintQueueCollection = printServer.GetPrintQueues(new[] { System.Printing.EnumeratedPrintQueueTypes.Local, System.Printing.EnumeratedPrintQueueTypes.Connections });

            this.m_ApplicationVersion     = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.GetApplicationVersion(this);
            this.m_ProcessorRunCollection = Business.Surgical.ProcessorRunCollection.GetAll(true);

            InitializeComponent();

            this.DataContext = this;
            this.Loaded     += new RoutedEventHandler(UserPreferences_Loaded);
            this.Closing    += UserPreferences_Closing;
        }
Exemple #7
0
 public Printer()
 {
     //Attempts to connect to the printserver
     try
     {
         myPrintServer = new System.Printing.PrintServer(@"\\ghsmsps01");
     }
     catch (Exception ex)
     {
         MessageBoxButtons buttons = MessageBoxButtons.RetryCancel;
         DialogResult      result;
         result = MessageBox.Show("Server not found", "Check your network connection", buttons);
         if (result == DialogResult.Cancel)
         {
             Environment.Exit(0);
         }
         else
         {
             Application.Restart();
             Environment.Exit(0);
         }
     }
     pqc = myPrintServer.GetPrintQueues();
 }
Exemple #8
0
        static void PrintingTest()
        {
            System.Printing.PrintServer printServer = new System.Printing.PrintServer(@"\\qsdc001");


            System.Printing.PrintQueueCollection printQueuesAvailable = printServer.GetPrintQueues();


            foreach (System.Printing.PrintQueue currentPrintQueue in printQueuesAvailable)
            {
                System.Diagnostics.Debug.WriteLine("Print Queue: " + currentPrintQueue.Name);



                System.Printing.PrintCapabilities capabilities = currentPrintQueue.GetPrintCapabilities();

                for (Int32 currentIndex = 0; currentIndex < capabilities.DuplexingCapability.Count; currentIndex++)
                {
                    System.Diagnostics.Debug.WriteLine("Duplexing: " + capabilities.DuplexingCapability[currentIndex].ToString());
                }


                for (Int32 currentIndex = 0; currentIndex < capabilities.OutputColorCapability.Count; currentIndex++)
                {
                    System.Diagnostics.Debug.WriteLine("Color: " + capabilities.OutputColorCapability[currentIndex].ToString());
                }


                for (Int32 currentIndex = 0; currentIndex < capabilities.OutputQualityCapability.Count; currentIndex++)
                {
                    System.Diagnostics.Debug.WriteLine("Quality: " + capabilities.OutputQualityCapability[currentIndex].ToString());
                }


                for (Int32 currentIndex = 0; currentIndex < capabilities.PageResolutionCapability.Count; currentIndex++)
                {
                    System.Diagnostics.Debug.WriteLine("Resolution: " + capabilities.PageResolutionCapability[currentIndex].ToString());
                }

                String printCapabilities = System.Text.ASCIIEncoding.ASCII.GetString(currentPrintQueue.GetPrintCapabilitiesAsXml().ToArray());

                printCapabilities = printCapabilities.Replace("<psf:", "<");

                printCapabilities = printCapabilities.Replace("</psf:", "</");

                System.Diagnostics.Debug.WriteLine(printCapabilities);

                System.Xml.XmlDocument capabilitiesXml = new System.Xml.XmlDocument();

                capabilitiesXml.LoadXml(printCapabilities);

                System.Diagnostics.Debug.WriteLine(printCapabilities);

                foreach (System.Xml.XmlNode currentNode in capabilitiesXml.SelectNodes("/PrintCapabilities/Feature[@name=\"psk:JobInputBin\"]/Option"))
                {
                    String printTrayName = currentNode.Attributes["name"].InnerText.Split(':')[currentNode.Attributes["name"].InnerText.Split(':').Length - 1];

                    Console.WriteLine(printTrayName);
                }

                foreach (System.Printing.InputBin currentInputBin in currentPrintQueue.GetPrintCapabilities().InputBinCapability)
                {
                    Console.WriteLine(currentInputBin);
                }
            }


            Console.WriteLine("\nPress Return to continue.");

            Console.ReadLine();



            return;
        }