/// <summary> /// Handles the Click event of the _buttonSwitchActiveDiscMasterFormat control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> private void _buttonSwitchActiveDiscMasterFormat_Click( object sender, EventArgs e ) { if ( _activeFormat == ActiveFormat.Data ) { _jolietDiscMaster.Dispose(); _jolietDiscMaster = null; _discMaster.Dispose(); _discMaster = null; GC.Collect(); _discMaster = new DiscMaster(); _discMaster.AddProgress += _discMaster_AddProgress; _discMaster.BlockProgress += _discMaster_BlockProgress; _discMaster.BurnComplete += _discMaster_BurnComplete; _discMaster.ClosingDisc += _discMaster_ClosingDisc; _discMaster.EraseComplete += _discMaster_EraseComplete; _discMaster.PnpActivity += _discMaster_PNPActivity; _discMaster.PreparingBurn += _discMaster_PreparingBurn; _discMaster.QueryCancel += _discMaster_QueryCancel; _discMaster.TrackProgress += _discMaster_TrackProgress; _discMaster.DiscRecorders.ActiveRecorderChanged += DiscRecorders_ActiveRecorderChanged; _redbookDiscMaster = _discMaster.RedbookDiscMaster; _groupBoxJoliet.Enabled = false; _groupBoxJolietActions.Enabled = false; _groupBoxRedbook.Enabled = true; _groupBoxRedbookActions.Enabled = true; _activeFormat = ActiveFormat.Audio; } else { _redbookDiscMaster.Dispose(); _redbookDiscMaster = null; _discMaster.Dispose(); _discMaster = null; GC.Collect(); _discMaster = new DiscMaster(); _discMaster.AddProgress += _discMaster_AddProgress; _discMaster.BlockProgress += _discMaster_BlockProgress; _discMaster.BurnComplete += _discMaster_BurnComplete; _discMaster.ClosingDisc += _discMaster_ClosingDisc; _discMaster.EraseComplete += _discMaster_EraseComplete; _discMaster.PnpActivity += _discMaster_PNPActivity; _discMaster.PreparingBurn += _discMaster_PreparingBurn; _discMaster.QueryCancel += _discMaster_QueryCancel; _discMaster.TrackProgress += _discMaster_TrackProgress; _discMaster.DiscRecorders.ActiveRecorderChanged += DiscRecorders_ActiveRecorderChanged; _jolietDiscMaster = _discMaster.JolietDiscMaster; _groupBoxRedbook.Enabled = false; _groupBoxRedbookActions.Enabled = false; _groupBoxJoliet.Enabled = true; _groupBoxJolietActions.Enabled = true; _activeFormat = ActiveFormat.Data; } RefreshGroups(); }
/// <summary> /// Initializes a new instance of the <see cref="T:MainForm"/> class. /// </summary> public MainForm() { InitializeComponent(); try { _discMaster = new DiscMaster(); } catch { LockGroups(); return; } _discMaster.AddProgress += ThreadSafe.EventHandler<ProgressEventArgs>( this, _discMaster_AddProgress ); _discMaster.BlockProgress += ThreadSafe.EventHandler<ProgressEventArgs>( this, _discMaster_BlockProgress ); _discMaster.BurnComplete += ThreadSafe.EventHandler<CompletionStatusEventArgs>( this, _discMaster_BurnComplete ); _discMaster.ClosingDisc += ThreadSafe.EventHandler<EstimatedTimeOperationEventArgs>( this, _discMaster_ClosingDisc ); _discMaster.EraseComplete += ThreadSafe.EventHandler<CompletionStatusEventArgs>( this, _discMaster_EraseComplete ); _discMaster.PnpActivity += ThreadSafe.EventHandler<EventArgs>( this, _discMaster_PNPActivity ); _discMaster.PreparingBurn += ThreadSafe.EventHandler<EstimatedTimeOperationEventArgs>( this, _discMaster_PreparingBurn ); _discMaster.QueryCancel += ThreadSafe.EventHandler<QueryCancelEventArgs>( this, _discMaster_QueryCancel ); _discMaster.TrackProgress += ThreadSafe.EventHandler<ProgressEventArgs>( this, _discMaster_TrackProgress ); _discMaster.DiscRecorders.ActiveRecorderChanged += ThreadSafe.EventHandler<EventArgs>( this, DiscRecorders_ActiveRecorderChanged ); _jolietDiscMaster = _discMaster.JolietDiscMaster; if ( _discMaster.DiscRecorders.ActiveDiscRecorder == null ) { LockGroups(); } RefreshGroups(); _simulate = 1; _ejectWhenComplete = 0; _overwrite = true; _activeFormat = ActiveFormat.Data; }