/// <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; } }
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); } }
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)); } } } }
/// <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)); } } }
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)); } } }
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"); }
static void printer_PrintJobSucceeded(object obj, PrintJobEventArgs e) { Console.WriteLine("Print Succeeded : JobId = " + e.PrintJob.JobId); }
static void printer_PrintJobUpdated(object obj, PrintJobEventArgs e) { Console.WriteLine("PrintJob Updated: JobId = " + e.PrintJob.JobId + " PrintStatus = " + e.PrintJob.Status + " PagesPrinted = " + e.PrintJob.PagesPrinted); }
/// <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); }
private static void OnPagePrinted(object sender, PrintJobEventArgs e) { System.Console.Write("p"); }
/// <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"); }
private static void PrinterMonitor_JobDeleted(object sender, PrintJobEventArgs e) { Job.PromotionalAccount(e.PrintJob.JobId); }
/// <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(); }