Exemplo n.º 1
0
        public void InternalPrinterStatusTest()
        {
            ApplicationEntity host = new ApplicationEntity("PRINTER", IPAddress.Parse("10.95.16.219"), 5042);

            Server server = StartServer(host.Title, host.Port, null);

            PrintServiceSCU print = new PrintServiceSCU(SOPClass.BasicGrayscalePrintManagementMetaSOPClass);

            print.Syntaxes.Add(Syntax.ImplicitVrLittleEndian);

            Association association = new Association();

            association.AddService(print);

            PrinterStatusEventHandler handler = new PrinterStatusEventHandler(OnPrinterStatus);

            print.PrinterStatus += handler;

            if (association.Open(host))
            {
                if (print.Active)
                {
                    PrinterStatusEventArgs status = print.GetPrinterStatus();
                }
            }
            else
            {
                Debug.WriteLine("\ncan't Open.");
            }

            association.Close();

            server.Stop();
        }
Exemplo n.º 2
0
        public static void OnPrinterStatus(object sender, PrinterStatusEventArgs e)
        {
            DataSet dicom = e.DataSet;

            Debug.WriteLine("Printer Status:\n" + dicom.Dump());
        }