示例#1
0
        internal HalDevice(Volume volume)
        {
            this.volume = volume;

            volume_info = new HalVolumeInfo (volume);
            production_info = new HalProductionInfo (volume);
            model_info = new HalModelInfo (volume);

            if (volume.PropertyExists (PodsleuthPrefix + "control_path")) {
                string relative_control = volume.GetPropertyString (PodsleuthPrefix + "control_path");
                if (relative_control[0] == Path.DirectorySeparatorChar) {
                    relative_control = relative_control.Substring (1);
                }

                ControlPath = Path.Combine(VolumeInfo.MountPoint, relative_control);
            }

            ArtworkFormats = new ReadOnlyCollection<ArtworkFormat> (LoadArtworkFormats ());

            if (volume.PropertyExists (PodsleuthPrefix + "firmware_version")) {
                FirmwareVersion = volume.GetPropertyString (PodsleuthPrefix + "firmware_version");
            }

            if (volume.PropertyExists (PodsleuthPrefix + "firewire_id")) {
                FirewireId = volume.GetPropertyString (PodsleuthPrefix + "firewire_id");
            }

            RescanDisk ();
        }
示例#2
0
 public HalProductionInfo(Volume volume)
 {
     SerialNumber = volume.GetPropertyString (PodsleuthPrefix + "serial_number");
     FactoryId = volume.GetPropertyString (PodsleuthPrefix + "production.factory_id");
     Number = volume.GetPropertyInteger (PodsleuthPrefix + "production.number");
     Week = volume.GetPropertyInteger (PodsleuthPrefix + "production.week");
     Year = volume.GetPropertyInteger (PodsleuthPrefix + "production.year");
 }
示例#3
0
 public HalVolumeInfo(Volume volume)
 {
     MountPoint = volume.GetPropertyString ("volume.mount_point");
     Label = volume.GetPropertyString ("volume.label");
     IsMountedReadOnly = volume.GetPropertyBoolean ("volume.is_mounted_read_only");
     Uuid = volume.GetPropertyString ("volume.uuid");
 }
示例#4
0
            public HalModelInfo(Volume volume)
            {
                AdvertisedCapacity = GetVolumeSizeString (volume);

                IsUnknown = true;
                if (volume.PropertyExists (PodsleuthPrefix + "is_unknown")) {
                    IsUnknown = volume.GetPropertyBoolean (PodsleuthPrefix + "is_unknown");
                }

                if (volume.PropertyExists (PodsleuthPrefix + "images.album_art_supported")) {
                    AlbumArtSupported = volume.GetPropertyBoolean (PodsleuthPrefix + "images.album_art_supported");
                }

                if (volume.PropertyExists (PodsleuthPrefix + "images.photos_supported")) {
                    PhotosSupported = volume.GetPropertyBoolean (PodsleuthPrefix + "images.photos_supported");
                }

                if (volume.PropertyExists (PodsleuthPrefix + "model.device_class")) {
                    DeviceClass = volume.GetPropertyString (PodsleuthPrefix + "model.device_class");
                }

                if (volume.PropertyExists (PodsleuthPrefix + "model.generation")) {
                    Generation = volume.GetPropertyDouble (PodsleuthPrefix + "model.generation");
                }

                if (volume.PropertyExists (PodsleuthPrefix + "model.shell_color")) {
                    ShellColor = volume.GetPropertyString (PodsleuthPrefix + "model.shell_color");
                }

                if (volume.PropertyExists ("info.icon_name")) {
                    IconName = volume.GetPropertyString ("info.icon_name");
                }

                if (volume.PropertyExists (PodsleuthPrefix + "capabilities")) {
                    foreach (string capability in volume.GetPropertyStringList (PodsleuthPrefix + "capabilities")) {
                        AddCapability (capability);
                    }
                }
            }