public void RawBurn( Form frm, string strPath ) { try { _burn = new XPBurnCD(); _burn.BurnerDrive = (string)_burn.RecorderDrives[0]; } catch ( Exception ex ) { Global.showMsgBox( frm, ex.Message ); return; } long lSize = 0; foreach ( string strFN in Directory.GetFiles(strPath) ) if ( !strFN.EndsWith(".emf") ) { FileInfo fi = new FileInfo(strFN); lSize += 1+fi.Length/1024; _burn.AddFile( strFN, "\\" + Path.GetFileName(strFN) ); } string strMediaType = (lSize/1024)>600 ? "DVD" : "CD"; if ( MessageBox.Show( frm, "Sätt i en " + strMediaType + " i brännaren och tryck OK för att starta.", Global.AppName, MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation ) != DialogResult.OK ) return; try { _burn.VolumeName = Path.GetFileName( strPath ); using ( frmBränning dlg = new frmBränning(_burn) ) dlg.ShowDialog(); } catch ( Exception ex ) { Global.showMsgBox( frm, ex.Message ); } }
public void BurnToCD(ImageCollection images) { if (_burnCD != null) { throw new InvalidOperationException("An existing burning session is in progress."); } try { _burnCD = new XPBurnCD(); _burnCD.ActiveFormat = RecordType.afData; _burnCD.AddProgress += new NotifyCDProgress(OnAddProgress); _burnCD.BurnComplete += new NotifyCompletionStatus(OnBurnComplete); _burnCD.ClosingDisc += new NotifyEstimatedTime(OnClosingDisc); _burnCD.EraseComplete += new NotifyCompletionStatus(OnEraseComplete); _burnCD.PreparingBurn += new NotifyEstimatedTime(OnPreparingBurn); _burnCD.RecorderChange += new NotifyPnPActivity(OnRecorderChange); _burnCD.TrackProgress += new NotifyCDProgress(OnTrackProgress); _burnCD.BlockProgress +=new NotifyCDProgress(OnBlockProgress); // _burnCD.ErrorHappened +=new NotifyErrorStatus(ErrorHappened); foreach (ImageInfo ii in images) { _burnCD.AddFile(ii.ImagePath, ii.ImagePath); } if (_burnCD.MediaInfo.isWritable) { _burnCD.RecordDisc(false, false); } } catch (Exception ex) { AddMessage(ex.ToString()); } }
private void OnBurnComplete(uint status) { AddMessage(string.Format("burn complete, status = {0}", status)); _burnCD = null; Close(); }
/* public override void skolaUppdaterad() { _skola = Global.Skola; fyllCombo( cboCDP, _skola.CDLeveranserPhotomic ); fyllCombo( cboCDT, _skola.CDLeveranserThiele ); } */ public override void activated() { if ( m_strBurnError==null ) try { m_burn = new XPBurnCD(); m_burn.BurnerDrive = (string)m_burn.RecorderDrives[0]; m_strBurnError = ""; } catch ( Exception ex ) { m_strBurnError = ex.Message; m_burn = null; } setStatusText( m_strBurnError ); }