Esempio n. 1
0
 /// <summary>
 /// The PrintJob_Succeeded
 /// </summary>
 /// <param name="sender">The sender<see cref="object"/></param>
 /// <param name="e">The e<see cref="PrintJobEventArgs"/></param>
 private void PrintJob_Succeeded(object sender, PrintJobEventArgs e)
 {
     Console.WriteLine("Succedded");
     if (bntPink.InvokeRequired)
     {
         bntPink.Invoke(new MethodInvoker(() => { UpdateControls(ConfigState.TEST_PRINT_COMPLETE); }));
         Console.WriteLine("Completed!!!");
     }
 }
 private void PrintTask_JobCompleted(object sender, PrintJobEventArgs e)
 {
     this.IsBusy = false;
     if (e.PrintResult != null)
     {
         linkExportResult.NavigateUri = e.PrintResult.Url;
         linkExportResult.Visibility  = System.Windows.Visibility.Visible;
     }
 }
Esempio n. 3
0
 private void OnJobPrinted(Object sender, PrintJobEventArgs args)
 {
     System.IO.FileStream file = null;
     System.Runtime.Serialization.Formatters.Soap.SoapFormatter formatter = new System.Runtime.Serialization.Formatters.Soap.SoapFormatter();
     using (file = new System.IO.FileStream("session.xml", System.IO.FileMode.Create))
     {
         formatter.Serialize(file, args.Session);
     }
 }
Esempio n. 4
0
 private void OnJobPrinted(object sender, PrintJobEventArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new PrintJobEventHandler(OnJobPrinted), new object[] { sender, e });
     }
     else
     {
         FilmSession session = e.Session;
         //if (File.Exists("delete.me"))
         //{
         //    System.IO.FileStream file = null;
         //    System.Runtime.Serialization.Formatters.Soap.SoapFormatter formatter = new System.Runtime.Serialization.Formatters.Soap.SoapFormatter();
         //    try
         //    {
         //        using (file = new System.IO.FileStream("session.xml", System.IO.FileMode.Create))
         //        {
         //            formatter.Serialize(file, session);
         //        }
         //    }
         //    finally
         //    {
         //        if (file != null)
         //        {
         //            file.Close();
         //            file.Dispose();
         //            file = null;
         //        }
         //    }
         //}
         NewBrowser(session.Dicom);
         foreach (FilmBox filmbox in session.FilmBoxes)
         {
             try
             {
                 NewBrowser(filmbox.Dicom);
                 foreach (ImageBox image in filmbox.ImageBoxes)
                 {
                     try
                     {
                         NewBrowser(image.Dicom);
                     }
                     catch (Exception ex)
                     {
                         MessageBox.Show(Logging.Log(ex));
                     }
                 }
             }
             catch (Exception ex)
             {
                 MessageBox.Show(Logging.Log(ex));
             }
         }
     }
 }
Esempio n. 5
0
        /// <summary>
        /// טיפול בארוע של הדפסה
        /// </summary>
        private static void PrinterMonitor_JobAdded(object sender, PrintJobEventArgs e)
        {
            Job.PauseJob(e.PrintJob.JobId);
            Job    job      = new Job(e.PrintJob);
            string response = job.CheckPrintPermissions();

            if (response == "OK")
            {
                Job.ResumeJob(e.PrintJob.JobId);
            }
            else
            {
                e.PrintJob.Cancel();
            }
            job.OpenWinForm(e.PrintJob.MachineName, response);
        }
        async void PrinterMonitor_JobDeleted(object sender, PrintJobEventArgs args)
        {
            if (args.PrintJob.StatusDescription == "Printed")
            {
                if (_isPrinted++ == 0 && args.PrintJob.Printed)
                {
                    UpdateStatus(_currentJob, Texts.Printed);
                    rtbLog.BeginInvoke(new InvokeDelegate(InvokeJobEnd));
                    var rs = await PatchStatus(_currentJob, Texts.Printed);

                    if (!String.IsNullOrEmpty(rs))
                    {
                        rtbLog.BeginInvoke(new InvokeStatusDelegate(InvokePatchStatus), new object[] { rs });
                    }
                }
            }
        }
        void PrinterMonitor_JobSet(object sender, PrintJobEventArgs args)
        {
            if (args.PrintJob.StatusDescription == "Printing")
            {
                if (_isPrinting++ == 0 && args.PrintJob.Printing)
                {
                    UpdateStatus(_currentJob, Texts.InPrint);
                    rtbLog.BeginInvoke(new InvokeDelegate(InvokeJobPrinting));
                }
            }

            if (String.IsNullOrEmpty(args.PrintJob.StatusDescription))
            {
                if (_isDeleting++ == 0 && args.PrintJob.Deleting && args.PrintJob.Deleted)
                {
                    UpdateStatus(_currentJob, Texts.Published);
                    rtbLog.BeginInvoke(new InvokeDelegate(InvokeJobCancel));
                }
            }
        }
Esempio n. 8
0
 private void OnPagePrinted(object sender, PrintJobEventArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new PrintJobEventHandler(OnPagePrinted), new object[] { sender, e });
     }
     else
     {
         FilmBox page = e.Session.FilmBoxes[0];
         //try
         //{
         //    if (File.Exists("delete.me"))
         //    {
         //        int temp = accession++;
         //        page.Dicom.Write(String.Format("filmbox{0}.dcm", temp));
         //        foreach (ImageBox image in page.ImageBoxes)
         //        {
         //            ushort position = (ushort)image.Dicom[t.ImageBoxPosition].Value;
         //            image.Dicom.Write(String.Format("imagebox{0}.{1}.dcm", temp, position));
         //        }
         //        return;
         //    }
         //}
         //catch (Exception ex)
         //{
         //    MessageBox.Show(Logging.Log(ex));
         //}
         try
         {
             NewViewer(page);
         }
         catch (Exception ex)
         {
             MessageBox.Show(Logging.Log(ex));
         }
     }
 }
Esempio n. 9
0
        private void OnImagePrinted(object sender, PrintJobEventArgs e)
        {
            var message  = string.Empty;
            var hasError = true;

            try
            {
                var page     = e.Session.FilmBoxes[0];
                var elements = OtherImageFormats.RenderPage(page);

                var receivedDicomElements = new ReceivedDicomElements
                {
                    CallingAeTitle     = e.CallingAeTitle,
                    CallingAeIpAddress = e.CallingAeIpAddress,
                    ReceivedDateTime   = DateTime.Now,
                    Elements           = elements,
                    ImageSource        = ImageSource.Print,
                    ImageStatus        = dicomServiceWorkerUser.OpenWhenReceived() ? ImageMemoryStatus.OpenedInWindow : ImageMemoryStatus.CachedInMemory
                };

                message = string.Format("AeTitle : {0}, IpAddress : {1}", receivedDicomElements.CallingAeTitle, receivedDicomElements.IpAddress);

                OnDicomElementsReceived(receivedDicomElements);

                message  = "Print successfull! -- " + message;
                hasError = false;
            }
            catch (Exception ex)
            {
                message = "Print failed! -- " + message + "  " + ex.Message;
            }
            finally
            {
                dicomServiceWorkerUser.ShowMessage(message, hasError, false);
            }
        }
		/// <summary>		
		/// This event is used to open exported printable output file from an asynchronous-server when printing with ArcGIS server.
		/// </summary>		
		private void PrintTask_JobCompleted(object sender, PrintJobEventArgs e)
		{
			IsBusy = IsPrinting = printTask.IsBusy;
			if (e.Error != null || e.PrintResult == null)
			{
				Error = e.Error;
				return;
			}
			Status = Resources.Strings.PrintCompleted;
			var uri = e.PrintResult.Url;
			if (UseProxy && !string.IsNullOrEmpty(printTask.ProxyURL))
				uri = new Uri(string.Concat(printTask.ProxyURL, "?", e.PrintResult.Url.OriginalString));
			System.Windows.Browser.HtmlPage.Window.Navigate(uri, "_blank");
		}
Esempio n. 11
0
 static void printer_PrintJobSucceeded(object obj, PrintJobEventArgs e)
 {
     Console.WriteLine("Print Succeeded : JobId = " + e.PrintJob.JobId);
 }
Esempio n. 12
0
 static void printer_PrintJobUpdated(object obj, PrintJobEventArgs e)
 {
     Console.WriteLine("PrintJob Updated: JobId = " + e.PrintJob.JobId + "  PrintStatus = " + e.PrintJob.Status + "  PagesPrinted = " + e.PrintJob.PagesPrinted);
 }
Esempio n. 13
0
 /// <summary>
 /// The PrintJob_Updated
 /// </summary>
 /// <param name="sender">The sender<see cref="object"/></param>
 /// <param name="e">The e<see cref="PrintJobEventArgs"/></param>
 private void PrintJob_Updated(object sender, PrintJobEventArgs e)
 {
     Console.WriteLine("Printing Page: " + e.PrintJob.PagesPrinted);
 }
Esempio n. 14
0
 private static void OnPagePrinted(object sender, PrintJobEventArgs e)
 {
     System.Console.Write("p");
 }
Esempio n. 15
0
 /// <summary>
 /// When page is updated
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PrintJob_Updated(object sender, PrintJobEventArgs e)
 {
     Console.WriteLine("PrintJob_Updated");
 }
Esempio n. 16
0
 private static void PrinterMonitor_JobDeleted(object sender, PrintJobEventArgs e)
 {
     Job.PromotionalAccount(e.PrintJob.JobId);
 }
Esempio n. 17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void PrintJob_Succeeded(object sender, PrintJobEventArgs e)
 {
     Console.WriteLine("PrintJob_Succeeded");
     isPrintSuccess = true;
     waitHandle.Set();
 }