Ejemplo n.º 1
0
        protected override bool DeviceCommandMatchesSource(DiscSource source, DeviceCommand command)
        {
            DvdSource dvdSource = source as DvdSource;

            if (dvdSource != null && command.DeviceId.StartsWith ("dvd:")) {
                try {
                    Uri uri = new Uri (command.DeviceId);
                    string match_device_node = String.Format ("{0}{1}", uri.Host,
                        uri.AbsolutePath).TrimEnd ('/', '\\');
                    string device_node = source.DiscModel.Volume.DeviceNode;
                    return device_node.EndsWith (match_device_node);
                } catch {
                }
            }

            return false;
        }
Ejemplo n.º 2
0
        protected override bool DeviceCommandMatchesSource(DiscSource source, DeviceCommand command)
        {
            DvdSource dvdSource = source as DvdSource;

            if (dvdSource != null && command.DeviceId.StartsWith("dvd:"))
            {
                try {
                    Uri    uri = new Uri(command.DeviceId);
                    string match_device_node = String.Format("{0}{1}", uri.Host,
                                                             uri.AbsolutePath).TrimEnd('/', '\\');
                    string device_node = source.DiscModel.Volume.DeviceNode;
                    return(device_node.EndsWith(match_device_node));
                } catch {
                }
            }

            return(false);
        }