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.
Property | Description |
---|---|
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. |
This event is fired for progress events on the MediaWriterDrive object.
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";
}