Exemple #1
0
 public EraseIn(string bufferData, EraseType type) : base(bufferData)
 {
     this.Direction = Parameter.Unknown;
     this.Type      = type;
     if (this.IsExtended)
     {
         return; // extended means selective erase which we don't support.
     }
     if (this.Parameters.Count == 0)
     {
         this.Direction = Parameter.Before;
     }
     if (this.Parameters.Count == 1 && uint.TryParse(this.Parameters[0], out var param))
     {
         param          = Math.Min((uint)Parameter.Unknown, param);
         this.Direction = (Parameter)param;
     }
 }
        public void Erase(EraseSettings settings)
        {
            if (null == m_device)
            {
                throw new BurnerException(NO_DEVICE, NO_DEVICE_TEXT);
            }

            MediaProfile mp = m_device.MediaProfile;

            if (MediaProfile.DvdMinusRwSeq != mp && MediaProfile.DvdMinusRwRo != mp && MediaProfile.CdRw != mp)
            {
                throw new BurnerException(ERASE_NOT_SUPPORTED, ERASE_NOT_SUPPORTED_TEXT);
            }

            if (m_device.MediaIsBlank && !settings.Force)
            {
                return;
            }

            m_device.OnErase += new EventHandler <DeviceEraseEventArgs>(Device_Erase);

            EraseType et = EraseType.Minimal;

            if (settings.Quick)
            {
                et = EraseType.Minimal;
            }
            else
            {
                et = EraseType.Disc;
            }

            bool bRes = m_device.Erase(et);

            m_device.OnErase -= Device_Erase;

            if (!bRes)
            {
                throw new BurnerException(m_device.Error);
            }

            // Refresh to reload disc information
            m_device.Refresh();
        }
Exemple #3
0
 public Charm Erase(EraseType type)
 {
     return this;
 }