OnProgress Event

Summary
The event delegate for writable drive progress events.
Syntax
C#
C++/CLI
public event EventHandler<MediaWriterProgressEventArgs> OnProgress 
public: 
event EventHandler<MediaWriterProgressEventArgs^>^ OnProgress 
Event Data

The event handler receives an argument of type MediaWriterProgressEventArgs containing data related to this event. The following MediaWriterProgressEventArgs properties provide information specific to this event.

PropertyDescription
Cancel The cancelable property for this event type.
Complete Variable containing the current completion status of the writable drive operation.
Description String value description of the current operation being performed, or error encountered.
Progress Variable containing the current progress of the writable drive operation.
State Variable containing the current state of the writable drive operation.
Remarks

This event is fired for progress events on the MediaWriterDrive object.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.MediaWriter; 
 
 
public void BurnDiscExample() 
{ 
   try 
   { 
      MediaWriter writer = new MediaWriter(); 
      List<MediaWriterDrive> drives = writer.Drives; 
      MediaWriterDrive drive = drives[1]; 
      MediaWriterDisc disc = drive.CreateDisc(); 
 
      disc.VolumeName = "TEST DISC"; 
      disc.SourcePathName = Path.Combine(LEAD_VARS.ImagesDir, "InputFiles"); 
 
      drive.AutoEject = true; 
 
      drive.OnProgress += BurnProgress; 
 
      drive.LoadDisc(); 
 
      // BurnDisc starts 
      drive.BurnDisc(disc); 
 
      // wait loop for demonstration purposes 
      while (drive.State != MediaWriterState.StateIdle) 
      { 
         System.Windows.Forms.Application.DoEvents(); 
         System.Threading.Thread.Sleep(10); 
      } 
 
      drive.OnProgress -= BurnProgress; 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show("Test Failed: " + ex.Message); 
   } 
} 
 
public void BurnProgress(Object sender, EventArgs evt) 
{ 
   System.Diagnostics.Debug.WriteLine(evt.ToString()); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.MediaWriter Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.