Example #1
0
        public override bool Equals(object obj)
        {
            DvdMedia drv = obj as DvdMedia;

            if (drv == null)
            {
                return(false);
            }

            return(_dvdPath == drv._dvdPath && Label == drv.Label);
        }
Example #2
0
        public static List <DvdMedia> GetAllDvdMedias()
        {
            List <DvdMedia> drives = new List <DvdMedia>();

            try
            {
                foreach (DriveInfo drvInfo in DriveInfo.GetDrives())
                {
                    string drivePath = drvInfo.RootDirectory.FullName;

                    DvdMedia dvdDrive = DvdMedia.FromPath(drivePath);
                    if (dvdDrive != null)
                    {
                        drives.Add(dvdDrive);
                    }
                }
            }
            catch
            {
            }

            return(drives);
        }
 private void lbDvdMedias_SelectedIndexChanged(object sender, EventArgs e)
 {
     _selectedMedia = lbDvdMedias.SelectedItem as DvdMedia;
 }
        private void btnOpenDvdFolder_Click(object sender, EventArgs e)
        {
            OPMFolderBrowserDialog dlg = new OPMFolderBrowserDialog();
            dlg.ShowNewFolderButton = false;
            dlg.Description = Translator.Translate("TXT_LOAD_DVD_FOLDER");
            dlg.PerformPathValidation += new PerformPathValidationHandler(dlg_PerformPathValidation);

            dlg.InheritAppIcon = false;
            dlg.Icon = this.Icon;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    _selectedMedia = DvdMedia.FromPath(dlg.SelectedPath);
                }
                catch 
                {
                    _selectedMedia = null;
                }

                if (_selectedMedia != null)
                {
                    DialogResult = DialogResult.OK;
                    Close();
                }
                else
                {
                    MessageDisplay.Show(Translator.Translate("TXT_INVALIDDVDVOLUME"),
                        Translator.Translate("TXT_ERROR"), MessageBoxIcon.Warning);
                }
            }
        }