├── .gitignore
├── LICENSE
├── README.md
├── small.png
├── src
├── CHIMP
│ ├── CHIMP.sln
│ └── CHIMP
│ │ ├── Actions
│ │ ├── ActionBase.cs
│ │ ├── BootableAction.cs
│ │ ├── BrowseAction.cs
│ │ ├── EjectAction.cs
│ │ ├── InstallActionBase.cs
│ │ ├── ScriptableAction.cs
│ │ └── SwitchAction.cs
│ │ ├── App.config
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Assets
│ │ ├── app.ico
│ │ └── app.png
│ │ ├── CHIMP.csproj
│ │ ├── Containers
│ │ ├── ActionContainer.cs
│ │ ├── ControllerContainer.cs
│ │ ├── PageContainer.cs
│ │ └── VolumeContainer.cs
│ │ ├── Controllers
│ │ ├── ActionController.cs
│ │ ├── CameraController.cs
│ │ ├── CardController.cs
│ │ ├── Controller.cs
│ │ ├── DownloadController.cs
│ │ ├── EjectController.cs
│ │ ├── InstallController.cs
│ │ ├── IntroController.cs
│ │ ├── LicensesController.cs
│ │ ├── SoftwareController.cs
│ │ └── SummaryController.cs
│ │ ├── Controls
│ │ ├── CameraInfoControl.xaml
│ │ ├── CameraInfoControl.xaml.cs
│ │ ├── CardInfoControl.xaml
│ │ ├── CardInfoControl.xaml.cs
│ │ ├── EjectControl.xaml
│ │ ├── EjectControl.xaml.cs
│ │ ├── LicensesControl.xaml
│ │ ├── LicensesControl.xaml.cs
│ │ ├── SelectActionControl.xaml
│ │ ├── SelectActionControl.xaml.cs
│ │ ├── SelectItemControl.xaml
│ │ ├── SelectItemControl.xaml.cs
│ │ ├── SoftwareControl.xaml
│ │ ├── SoftwareControl.xaml.cs
│ │ ├── SoftwareInfoControl.xaml
│ │ ├── SoftwareInfoControl.xaml.cs
│ │ ├── SummaryControl.xaml
│ │ ├── SummaryControl.xaml.cs
│ │ ├── TipsControl.xaml
│ │ └── TipsControl.xaml.cs
│ │ ├── Converters
│ │ ├── BuildStatusConverter.cs
│ │ ├── DebugConverter.cs
│ │ ├── FirmwareVersionConverter.cs
│ │ ├── FlowDirectionConverter.cs
│ │ ├── InverseBooleanConverter.cs
│ │ ├── InverseBooleanToVisibilityConverter.cs
│ │ ├── NullToVisibilityConverter.cs
│ │ ├── ProductVersionConverter.cs
│ │ ├── ProgressStateConverter.cs
│ │ ├── ProgressValueConverter.cs
│ │ ├── ResourceConverter.cs
│ │ └── SizeConverter.cs
│ │ ├── Data
│ │ ├── Category
│ │ │ ├── EOS
│ │ │ │ ├── boot.json
│ │ │ │ └── hash2sw.json
│ │ │ └── PS
│ │ │ │ ├── boot.json
│ │ │ │ └── hash2sw.json
│ │ ├── Product
│ │ │ ├── 400PLUS
│ │ │ │ ├── cameras.json
│ │ │ │ ├── components.json
│ │ │ │ └── tips.json
│ │ │ ├── CHDK
│ │ │ │ ├── LANG
│ │ │ │ │ ├── english.lng
│ │ │ │ │ ├── german.lng
│ │ │ │ │ └── russian.lng
│ │ │ │ ├── cameras.json
│ │ │ │ ├── components.json
│ │ │ │ ├── distros.json
│ │ │ │ ├── sources.json
│ │ │ │ └── tips.json
│ │ │ ├── ML
│ │ │ │ ├── cameras.json
│ │ │ │ ├── components.json
│ │ │ │ ├── distros.json
│ │ │ │ ├── sources.json
│ │ │ │ └── tips.json
│ │ │ └── SDM
│ │ │ │ ├── cameras.json
│ │ │ │ ├── components.json
│ │ │ │ ├── distros.json
│ │ │ │ ├── sources.json
│ │ │ │ └── tips.json
│ │ ├── appsettings.json
│ │ ├── products.json
│ │ ├── script.json
│ │ └── tips.json
│ │ ├── Device.cs
│ │ ├── Disk.cs
│ │ ├── Downloaders
│ │ ├── BrowseDownloader.cs
│ │ └── Downloader.cs
│ │ ├── Installers
│ │ ├── ExFatInstaller.cs
│ │ ├── Fat32Installer.cs
│ │ ├── FatInstaller.cs
│ │ ├── FormatInstaller.cs
│ │ └── Installer.cs
│ │ ├── Interfaces
│ │ ├── Containers
│ │ │ ├── IControllerContainer.cs
│ │ │ ├── IPageContainer.cs
│ │ │ └── IVolumeContainer.cs
│ │ ├── IAction.cs
│ │ ├── IController.cs
│ │ ├── IDownloader.cs
│ │ ├── IInstaller.cs
│ │ ├── IServiceActivator.cs
│ │ ├── Providers
│ │ │ ├── IActionProvider.cs
│ │ │ ├── IBuildProvider.cs
│ │ │ ├── IDownloadProvider.cs
│ │ │ ├── IDownloaderProvider.cs
│ │ │ ├── IInstallerProvider.cs
│ │ │ ├── ILicenseProvider.cs
│ │ │ ├── IMatchProvider.cs
│ │ │ ├── IResourceProvider.cs
│ │ │ ├── ISoftwareProvider.cs
│ │ │ ├── IStepProvider.cs
│ │ │ └── ITipProvider.cs
│ │ └── Services
│ │ │ ├── IBootService.cs
│ │ │ ├── IDialogService.cs
│ │ │ ├── IDownloadService.cs
│ │ │ ├── IEjectService.cs
│ │ │ ├── IExtractService.cs
│ │ │ ├── IFormatService.cs
│ │ │ ├── IInstallService.cs
│ │ │ ├── IMetadataService.cs
│ │ │ ├── IPartitionService.cs
│ │ │ ├── IScriptService.cs
│ │ │ └── IToastService.cs
│ │ ├── LICENSE
│ │ ├── LoggerExtensions.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Model
│ │ ├── ActionsData.cs
│ │ ├── Distro.cs
│ │ ├── DownloadData.cs
│ │ ├── InstallersData.cs
│ │ ├── LicensesData.cs
│ │ ├── PartitionType.cs
│ │ ├── SoftwareData.cs
│ │ ├── StepsData.cs
│ │ └── Tip.cs
│ │ ├── NOTICE
│ │ ├── OperatingSystem.cs
│ │ ├── Pages
│ │ ├── ActionPage.xaml
│ │ ├── ActionPage.xaml.cs
│ │ ├── CameraPage.xaml
│ │ ├── CameraPage.xaml.cs
│ │ ├── CardPage.xaml
│ │ ├── CardPage.xaml.cs
│ │ ├── DownloadPage.xaml
│ │ ├── DownloadPage.xaml.cs
│ │ ├── EjectPage.xaml
│ │ ├── EjectPage.xaml.cs
│ │ ├── InstallPage.xaml
│ │ ├── InstallPage.xaml.cs
│ │ ├── IntroPage.xaml
│ │ ├── IntroPage.xaml.cs
│ │ ├── LicensesPage.xaml
│ │ ├── LicensesPage.xaml.cs
│ │ ├── SoftwarePage.xaml
│ │ ├── SoftwarePage.xaml.cs
│ │ ├── SummaryPage.xaml
│ │ └── SummaryPage.xaml.cs
│ │ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.fr.resx
│ │ ├── Resources.resx
│ │ ├── Resources.ru.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ │ ├── Providers
│ │ ├── Action
│ │ │ ├── ActionProvider.cs
│ │ │ ├── BootableActionProvider.cs
│ │ │ ├── BrowseActionProvider.cs
│ │ │ ├── EjectActionProvider.cs
│ │ │ ├── InstallActionProvider.cs
│ │ │ ├── InstallActionProviderBase.cs
│ │ │ ├── ScriptableActionProvider.cs
│ │ │ ├── SwitchActionProvider.cs
│ │ │ └── UpdateActionProvider.cs
│ │ ├── AggregateDownloaderProvider.cs
│ │ ├── AggregateTipProvider.cs
│ │ ├── Build
│ │ │ ├── BuildProvider.cs
│ │ │ ├── ChdkBuildProvider.cs
│ │ │ ├── MlBuildProvider.cs
│ │ │ └── SdmBuildProvider.cs
│ │ ├── ChdkResourceProvider.cs
│ │ ├── DataProvider.cs
│ │ ├── Downloads
│ │ │ ├── ChdkDownloadProvider.cs
│ │ │ ├── DownloadProvider.cs
│ │ │ ├── MlDownloadProvider.cs
│ │ │ └── SdmDownloadProvider.cs
│ │ ├── ExifCameraProvider.cs
│ │ ├── InstallerProvider.cs
│ │ ├── LicenseProvider.cs
│ │ ├── Matches
│ │ │ ├── ChdkDeMatchProvider.cs
│ │ │ ├── ChdkMatchProvider.cs
│ │ │ ├── MatchProvider.cs
│ │ │ ├── MlMatchProvider.cs
│ │ │ └── SdmMatchProvider.cs
│ │ ├── ProductTipProvider.cs
│ │ ├── Provider.cs
│ │ ├── Software
│ │ │ ├── ChdkSoftwareProvider.cs
│ │ │ ├── MlSoftwareProvider.cs
│ │ │ ├── SdmSoftwareProvider.cs
│ │ │ └── SoftwareProvider.cs
│ │ ├── StepProvider.cs
│ │ └── Tips
│ │ │ ├── AltTipProvider.cs
│ │ │ ├── EjectTipProvider.cs
│ │ │ ├── LanguageTipProvider.cs
│ │ │ ├── LedTipProvider.cs
│ │ │ ├── LockTipProvider.cs
│ │ │ ├── MenuTipProvider.cs
│ │ │ ├── RemoveTipProvider.cs
│ │ │ └── TipProvider.cs
│ │ ├── Resolvers
│ │ ├── BuildProviderResolver.cs
│ │ ├── DownloadProviderResolver.cs
│ │ ├── DownloaderResolver.cs
│ │ ├── MatchProviderResolver.cs
│ │ ├── ProviderResolver.cs
│ │ └── SoftwareProviderResolver.cs
│ │ ├── Resources
│ │ ├── intro_tips.json
│ │ ├── intro_tips_fr.json
│ │ └── intro_tips_ru.json
│ │ ├── ServiceActivator.cs
│ │ ├── Services
│ │ ├── BootService.cs
│ │ ├── BootServiceBase.cs
│ │ ├── DialogService.cs
│ │ ├── DownloadService.cs
│ │ ├── EjectService.cs
│ │ ├── ExtractService.cs
│ │ ├── FormatService.cs
│ │ ├── InstallService.cs
│ │ ├── MetadataService.cs
│ │ ├── PartitionService.cs
│ │ ├── ScriptService.cs
│ │ └── ToastService.cs
│ │ ├── SoftwareProductInfoExtensions.cs
│ │ ├── Themes
│ │ └── Generic.xaml
│ │ ├── ViewModels
│ │ ├── ActionItemViewModel.cs
│ │ ├── ActionViewModel.cs
│ │ ├── CameraItemViewModel.cs
│ │ ├── CameraViewModel.cs
│ │ ├── CardItemViewModel.cs
│ │ ├── CardViewModel.cs
│ │ ├── DownloadViewModel.cs
│ │ ├── EjectViewModel.cs
│ │ ├── InstallViewModel.cs
│ │ ├── IntroViewModel.cs
│ │ ├── ItemsViewModel.cs
│ │ ├── LicensesItemViewModel.cs
│ │ ├── LicensesViewModel.cs
│ │ ├── MainViewModel.cs
│ │ ├── ModulesItemViewModel.cs
│ │ ├── ModulesViewModel.cs
│ │ ├── SoftwareItemViewModel.cs
│ │ ├── SoftwareViewModel.cs
│ │ ├── StepItemViewModel.cs
│ │ ├── StepViewModel.cs
│ │ ├── SummaryViewModel.cs
│ │ └── ViewModel.cs
│ │ ├── Volume.cs
│ │ ├── app.manifest
│ │ ├── fat32format.exe
│ │ ├── logo.png
│ │ └── packages.config
├── CameraMetaGenerator
│ ├── CameraMetaGenerator.csproj
│ ├── CameraMetaGenerator.sln
│ ├── Data
│ │ ├── Category
│ │ │ └── PS
│ │ │ │ └── boot.json
│ │ └── products.json
│ └── Program.cs
├── Net.Chdk.Core
│ ├── CultureInfoExtensions.cs
│ ├── Directories.cs
│ ├── Files.cs
│ ├── Net.Chdk.Core.csproj
│ ├── Net.Chdk.Core.sln
│ └── StringExtensions.cs
├── Net.Chdk.Detectors.Base
│ ├── MetadataDetector.cs
│ └── Net.Chdk.Detectors.Base.csproj
├── Net.Chdk.Detectors.Camera.Core
│ ├── CameraDetectionException.cs
│ ├── ICameraDetector.cs
│ ├── IFileCameraDetector.cs
│ ├── IFilePatternProvider.cs
│ └── Net.Chdk.Detectors.Camera.Core.csproj
├── Net.Chdk.Detectors.Camera
│ ├── AllFileSystemCameraDetector.cs
│ ├── CameraDetector.cs
│ ├── FileCameraDetector.cs
│ ├── FileSystemCameraDetector.cs
│ ├── FileSystemCameraDetectorBase.cs
│ ├── IInnerCameraDetector.cs
│ ├── Net.Chdk.Detectors.Camera.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Detectors.CameraModel.Core
│ ├── CameraModels.cs
│ ├── ICameraModelDetector.cs
│ ├── IFileCameraModelDetector.cs
│ └── Net.Chdk.Detectors.CameraModel.Core.csproj
├── Net.Chdk.Detectors.CameraModel
│ ├── CameraModelDetector.cs
│ ├── CameraModelInfosExtensions.cs
│ ├── DerivedCameraModelDetector.cs
│ ├── FileCameraModelDetector.cs
│ ├── FileSystemCameraModelDetector.cs
│ ├── IInnerCameraModelDetector.cs
│ ├── IOuterCameraModelDetector.cs
│ ├── Net.Chdk.Detectors.CameraModel.csproj
│ ├── ServiceCollectionExtensions.cs
│ └── SoftwareCameraModelDetector.cs
├── Net.Chdk.Detectors.Card.Core
│ ├── ICardDetector.cs
│ └── Net.Chdk.Detectors.Card.Core.csproj
├── Net.Chdk.Detectors.Card
│ ├── CardDetector.cs
│ ├── Net.Chdk.Detectors.Card.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Detectors.Software.Chdk
│ ├── ChdkProductDetector.cs
│ ├── ChdkSoftwareDetector.cs
│ ├── Net.Chdk.Detectors.Software.Chdk.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Detectors.Software.Core
│ ├── IBinarySoftwareDetector.cs
│ ├── IFileSystemModulesDetector.cs
│ ├── IInnerBinarySoftwareDetector.cs
│ ├── IMetadataModulesDetector.cs
│ ├── IMetadataSoftwareDetector.cs
│ ├── IModulesDetector.cs
│ ├── IProductBinaryModuleDetector.cs
│ ├── IProductBinarySoftwareDetector.cs
│ ├── IProductDetector.cs
│ ├── ISoftwareDetector.cs
│ └── Net.Chdk.Detectors.Software.Core.csproj
├── Net.Chdk.Detectors.Software.Fhp
│ ├── FhpProductDetector.cs
│ ├── FhpSoftwareDetector.cs
│ ├── Net.Chdk.Detectors.Software.Fhp.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Detectors.Software.Ml
│ ├── BetaMlSoftwareDetector.cs
│ ├── MlModuleDetector.cs
│ ├── MlProductDetector.cs
│ ├── MlSoftwareDetector.cs
│ ├── Net.Chdk.Detectors.Software.Ml.csproj
│ ├── NightlyMlSoftwareDetector.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Detectors.Software.Product
│ ├── Net.Chdk.Detectors.Software.Product.csproj
│ ├── ProductBinaryDetector.cs
│ ├── ProductBinaryModuleDetector.cs
│ ├── ProductBinarySoftwareDetector.cs
│ ├── ProductDetector.cs
│ └── ProductDetectorBase.cs
├── Net.Chdk.Detectors.Software.Sdm
│ ├── Net.Chdk.Detectors.Software.Sdm.csproj
│ ├── SdmProductDetector.cs
│ ├── SdmSoftwareDetector.cs
│ ├── SdmSoftwareDetectorBase.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Detectors.Software
│ ├── BinaryDetectorWorker.cs
│ ├── BinaryModuleDetector.cs
│ ├── BinaryModuleDetectorWorker.cs
│ ├── BinarySoftwareDetector.cs
│ ├── BinarySoftwareDetectorBase.cs
│ ├── BinarySoftwareDetectorWorker.cs
│ ├── DerivedModuleDetector.cs
│ ├── EosBinarySoftwareDetector.cs
│ ├── EosHashSoftwareDetector.cs
│ ├── FileSystemModulesDetector.cs
│ ├── FileSystemSoftwareDetector.cs
│ ├── HashSoftwareDetector.cs
│ ├── IInnerModuleDetector.cs
│ ├── IInnerModulesDetector.cs
│ ├── IInnerSoftwareDetector.cs
│ ├── KnownPsBinarySoftwareDetector.cs
│ ├── MetadataModulesDetector.cs
│ ├── MetadataSoftwareDetector.cs
│ ├── ModulesDetector.cs
│ ├── Net.Chdk.Detectors.Software.csproj
│ ├── Offsets.cs
│ ├── ProgressState.cs
│ ├── PsBinarySoftwareDetector.cs
│ ├── PsHashSoftwareDetector.cs
│ ├── ServiceCollectionExtensions.cs
│ ├── SoftwareDetector.cs
│ ├── SoftwareDetectorSettings.cs
│ └── UnknownPsBinarySoftwareDetector.cs
├── Net.Chdk.Encoders.Binary.Core
│ ├── IBinaryDecoder.cs
│ ├── IBinaryEncoder.cs
│ └── Net.Chdk.Encoders.Binary.Core.csproj
├── Net.Chdk.Encoders.Binary
│ ├── BinaryDecoder.cs
│ ├── BinaryEncoder.cs
│ ├── BinaryEncoderDecoder.cs
│ ├── Net.Chdk.Encoders.Binary.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Json
│ ├── HexStringJsonConverter.cs
│ ├── JsonObject.cs
│ ├── Net.Chdk.Json.csproj
│ └── Net.Chdk.Json.sln
├── Net.Chdk.Meta.Generators.Platform.Base
│ ├── InnerPlatformGenerator.cs
│ ├── Net.Chdk.Meta.Generators.Platform.Base.csproj
│ └── Net.Chdk.Meta.Generators.Platform.Base.sln
├── Net.Chdk.Meta.Generators.Platform.Core
│ ├── IInnerPlatformGenerator.cs
│ ├── IPlatformGenerator.cs
│ ├── Net.Chdk.Meta.Generators.Platform.Core.csproj
│ └── Net.Chdk.Meta.Generators.Platform.Core.sln
├── Net.Chdk.Meta.Generators.Platform.Eos
│ ├── EosPlatformGenerator.cs
│ ├── EosPsPlatformGenerator.cs
│ ├── Net.Chdk.Meta.Generators.Platform.Eos.csproj
│ ├── Net.Chdk.Meta.Generators.Platform.Eos.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Generators.Platform.Ps
│ ├── IxusPlatformGenerator.cs
│ ├── Net.Chdk.Meta.Generators.Platform.Ps.csproj
│ ├── Net.Chdk.Meta.Generators.Platform.Ps.sln
│ ├── PsEosPlatformGenerator.cs
│ ├── PsPlatformGenerator.cs
│ ├── PsPlatformGeneratorBase.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Generators.Platform
│ ├── Net.Chdk.Meta.Generators.Platform.csproj
│ ├── Net.Chdk.Meta.Generators.Platform.sln
│ ├── PlatformGenerator.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Model.Base
│ ├── Net.Chdk.Meta.Model.Base.csproj
│ ├── Net.Chdk.Meta.Model.Base.sln
│ ├── PlatformData.cs
│ ├── RevisionData.cs
│ └── SourceData.cs
├── Net.Chdk.Meta.Model.Camera.Eos
│ ├── EosCameraData.cs
│ ├── EosCardData.cs
│ ├── Net.Chdk.Meta.Model.Camera.Eos.csproj
│ └── Net.Chdk.Meta.Model.Camera.Eos.sln
├── Net.Chdk.Meta.Model.Camera.Ps
│ ├── AltData.cs
│ ├── EncodingData.cs
│ ├── Net.Chdk.Meta.Model.Camera.Ps.csproj
│ ├── Net.Chdk.Meta.Model.Camera.Ps.sln
│ ├── PsCameraData.cs
│ └── PsCardData.cs
├── Net.Chdk.Meta.Model.Camera
│ ├── BootData.cs
│ ├── CameraData.cs
│ ├── CameraModelData.cs
│ ├── CardData.cs
│ ├── Net.Chdk.Meta.Model.Camera.csproj
│ └── Net.Chdk.Meta.Model.Camera.sln
├── Net.Chdk.Meta.Model.CameraList
│ ├── ListPlatformData.cs
│ ├── ListRevisionData.cs
│ ├── ListSourceData.cs
│ ├── Net.Chdk.Meta.Model.CameraList.csproj
│ └── Net.Chdk.Meta.Model.CameraList.sln
├── Net.Chdk.Meta.Model.CameraTree
│ ├── Net.Chdk.Meta.Model.CameraTree.csproj
│ ├── Net.Chdk.Meta.Model.CameraTree.sln
│ ├── TreePlatformData.cs
│ ├── TreeRevisionData.cs
│ └── TreeSourceData.cs
├── Net.Chdk.Meta.Model.Platform
│ ├── Net.Chdk.Meta.Model.Platform.csproj
│ ├── Net.Chdk.Meta.Model.Platform.sln
│ └── PlatformData.cs
├── Net.Chdk.Meta.Providers.Base
│ ├── Net.Chdk.Meta.Providers.Base.csproj
│ ├── Net.Chdk.Meta.Providers.Base.sln
│ ├── SingleCategoryProvider.cs
│ ├── SingleExtensionProvider.cs
│ └── SingleProductProvider.cs
├── Net.Chdk.Meta.Providers.Camera.Base
│ ├── CameraProvider.cs
│ ├── CategoryBuildProvider.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Base.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.Base.sln
│ ├── ProductCameraBootProvider.cs
│ ├── ProductCameraCardProvider.cs
│ ├── ProductCameraModelValidator.cs
│ ├── ProductCameraPlatformProvider.cs
│ └── ProductCameraValidator.cs
├── Net.Chdk.Meta.Providers.Camera.Chdk
│ ├── ChdkAltProvider.cs
│ ├── ChdkCameraBootProvider.cs
│ ├── ChdkCameraCardProvider.cs
│ ├── ChdkCameraModelValidator.cs
│ ├── ChdkCameraPlatformProvider.cs
│ ├── ChdkCameraValidator.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Chdk.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.Chdk.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Camera.Core
│ ├── IBuildProvider.cs
│ ├── ICameraBootProvider.cs
│ ├── ICameraCardProvider.cs
│ ├── ICameraModelProvider.cs
│ ├── ICameraModelValidator.cs
│ ├── ICameraPlatformProvider.cs
│ ├── ICameraProvider.cs
│ ├── ICameraValidator.cs
│ ├── ICategoryBuildProvider.cs
│ ├── IProductCameraBootProvider.cs
│ ├── IProductCameraCardProvider.cs
│ ├── IProductCameraModelValidator.cs
│ ├── IProductCameraPlatformProvider.cs
│ ├── IProductCameraValidator.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Core.csproj
│ └── Net.Chdk.Meta.Providers.Camera.Core.sln
├── Net.Chdk.Meta.Providers.Camera.Eos.Base
│ ├── EosCameraCardProvider.cs
│ └── Net.Chdk.Meta.Providers.Camera.Eos.Base.csproj
├── Net.Chdk.Meta.Providers.Camera.Eos.Core
│ ├── Net.Chdk.Meta.Providers.Camera.Eos.Core.csproj
│ └── Net.Chdk.Meta.Providers.Camera.Eos.Core.sln
├── Net.Chdk.Meta.Providers.Camera.Eos
│ ├── EosBuildProvider.cs
│ ├── EosCameraProvider.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Eos.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.Eos.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Camera.Fhp
│ ├── FhpCameraBootProvider.cs
│ ├── FhpCameraCardProvider.cs
│ ├── FhpCameraModelValidator.cs
│ ├── FhpCameraPlatformProvider.cs
│ ├── FhpCameraValidator.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Fhp.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.Fhp.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Camera.Ml
│ ├── MlCameraBootProvider.cs
│ ├── MlCameraCardProvider.cs
│ ├── MlCameraModelValidator.cs
│ ├── MlCameraPlatformProvider.cs
│ ├── MlCameraValidator.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Ml.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.Ml.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Camera.Ps.Base
│ ├── Net.Chdk.Meta.Providers.Camera.Ps.Base.csproj
│ ├── ProductAltProvider.cs
│ ├── PsCameraBootProvider.cs
│ └── PsCameraCardProvider.cs
├── Net.Chdk.Meta.Providers.Camera.Ps.Core
│ ├── IAltProvider.cs
│ ├── IEncodingProvider.cs
│ ├── IProductAltProvider.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Ps.Core.csproj
│ └── Net.Chdk.Meta.Providers.Camera.Ps.Core.sln
├── Net.Chdk.Meta.Providers.Camera.Ps
│ ├── AltProvider.cs
│ ├── EncodingProvider.cs
│ ├── Net.Chdk.Meta.Providers.Camera.Ps.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.Ps.sln
│ ├── PsBuildProvider.cs
│ ├── PsCameraProvider.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Camera.Sdm
│ ├── Net.Chdk.Meta.Providers.Camera.Sdm.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.Sdm.sln
│ ├── SdmAltProvider.cs
│ ├── SdmCameraBootProvider.cs
│ ├── SdmCameraCardProvider.cs
│ ├── SdmCameraModelValidator.cs
│ ├── SdmCameraPlatformProvider.cs
│ ├── SdmCameraValidator.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Camera
│ ├── BuildProvider.cs
│ ├── CameraBootProvider.cs
│ ├── CameraCardProvider.cs
│ ├── CameraModelProvider.cs
│ ├── CameraModelValidator.cs
│ ├── CameraPlatformProvider.cs
│ ├── CameraValidator.cs
│ ├── Net.Chdk.Meta.Providers.Camera.csproj
│ ├── Net.Chdk.Meta.Providers.Camera.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.CameraList.Core
│ ├── ICameraListProvider.cs
│ ├── IInnerCameraListProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraList.Core.csproj
│ └── Net.Chdk.Meta.Providers.CameraList.Core.sln
├── Net.Chdk.Meta.Providers.CameraList.Csv
│ ├── CsvCameraListProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraList.Csv.csproj
│ ├── Net.Chdk.Meta.Providers.CameraList.Csv.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.CameraList.Json
│ ├── JsonCameraListProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraList.Json.csproj
│ ├── Net.Chdk.Meta.Providers.CameraList.Json.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.CameraList.Zip
│ ├── Net.Chdk.Meta.Providers.CameraList.Zip.csproj
│ ├── Net.Chdk.Meta.Providers.CameraList.Zip.sln
│ ├── ServiceCollectionExtensions.cs
│ └── ZipCameraListProvider.cs
├── Net.Chdk.Meta.Providers.CameraList
│ ├── CameraListProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraList.csproj
│ ├── Net.Chdk.Meta.Providers.CameraList.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.CameraTree.Core
│ ├── ICameraTreeProvider.cs
│ ├── IInnerCameraTreeProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraTree.Core.csproj
│ └── Net.Chdk.Meta.Providers.CameraTree.Core.sln
├── Net.Chdk.Meta.Providers.CameraTree.Csv
│ ├── CsvCameraTreeProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraTree.Csv.csproj
│ ├── Net.Chdk.Meta.Providers.CameraTree.Csv.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.CameraTree.Json
│ ├── JsonCameraTreeProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraTree.Json.csproj
│ ├── Net.Chdk.Meta.Providers.CameraTree.Json.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.CameraTree.Src
│ ├── CameraData.cs
│ ├── CameraProvider.cs
│ ├── DataProvider.cs
│ ├── HeaderParsingProvider.cs
│ ├── MakefileParsingProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraTree.Src.csproj
│ ├── Net.Chdk.Meta.Providers.CameraTree.Src.sln
│ ├── ParsingProvider.cs
│ ├── PlatformProvider.cs
│ ├── RevisionData.cs
│ ├── RevisionProvider.cs
│ ├── ServiceCollectionExtensions.cs
│ ├── SourceProvider.cs
│ ├── SrcCameraTreeProvider.cs
│ └── ValueProvider.cs
├── Net.Chdk.Meta.Providers.CameraTree
│ ├── CameraTreeProvider.cs
│ ├── Net.Chdk.Meta.Providers.CameraTree.csproj
│ ├── Net.Chdk.Meta.Providers.CameraTree.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Core
│ ├── CameraInfo.cs
│ ├── ICameraMetaProvider.cs
│ ├── ICategoryNameProvider.cs
│ ├── IExtensionProvider.cs
│ ├── IProductCameraMetaProvider.cs
│ ├── IProductNameProvider.cs
│ ├── Net.Chdk.Meta.Providers.Core.csproj
│ └── Net.Chdk.Meta.Providers.Core.sln
├── Net.Chdk.Meta.Providers.Csv
│ ├── CsvCameraProvider.cs
│ ├── Net.Chdk.Meta.Providers.Csv.csproj
│ └── Net.Chdk.Meta.Providers.Csv.sln
├── Net.Chdk.Meta.Providers.Json
│ ├── JsonCameraProvider.cs
│ ├── Net.Chdk.Meta.Providers.Json.csproj
│ └── Net.Chdk.Meta.Providers.Json.sln
├── Net.Chdk.Meta.Providers.Platform.Base
│ ├── InnerPlatformProvider.cs
│ ├── Net.Chdk.Meta.Providers.Platform.Base.csproj
│ └── Net.Chdk.Meta.Providers.Platform.Base.sln
├── Net.Chdk.Meta.Providers.Platform.Core
│ ├── IInnerPlatformProvider.cs
│ ├── IPlatformProvider.cs
│ ├── Net.Chdk.Meta.Providers.Platform.Core.csproj
│ └── Net.Chdk.Meta.Providers.Platform.Core.sln
├── Net.Chdk.Meta.Providers.Platform.Html
│ ├── HtmlPlatformProvider.cs
│ ├── Net.Chdk.Meta.Providers.Platform.Html.csproj
│ ├── Net.Chdk.Meta.Providers.Platform.Html.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Platform.Xml
│ ├── Model
│ │ ├── Key.cs
│ │ ├── Table.cs
│ │ ├── Tag.cs
│ │ └── TagInfo.cs
│ ├── Net.Chdk.Meta.Providers.Platform.Xml.csproj
│ ├── Net.Chdk.Meta.Providers.Platform.Xml.sln
│ ├── ServiceCollectionExtensions.cs
│ └── XmlPlatformProvider.cs
├── Net.Chdk.Meta.Providers.Platform
│ ├── CameraModel.cs
│ ├── Net.Chdk.Meta.Providers.Platform.csproj
│ ├── Net.Chdk.Meta.Providers.Platform.sln
│ ├── PlatformProvider.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Sdm
│ ├── Net.Chdk.Meta.Providers.Sdm.csproj
│ ├── Net.Chdk.Meta.Providers.Sdm.sln
│ ├── SdmCameraMetaProvider.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Software.Core
│ ├── IBuildMetaProvider.cs
│ ├── ICategoryMetaProvider.cs
│ ├── ICompilerMetaProvider.cs
│ ├── IEncodingMetaProvider.cs
│ ├── IProductMetaProvider.cs
│ ├── ISoftwareMetaProvider.cs
│ ├── ISourceMetaProvider.cs
│ ├── Net.Chdk.Meta.Providers.Software.Core.csproj
│ └── Net.Chdk.Meta.Providers.Software.Core.sln
├── Net.Chdk.Meta.Providers.Software.Sdm
│ ├── Net.Chdk.Meta.Providers.Software.Sdm.csproj
│ ├── Net.Chdk.Meta.Providers.Software.Sdm.sln
│ ├── SdmProductMetaProvider.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Providers.Software.Zip
│ ├── Net.Chdk.Meta.Providers.Software.Zip.csproj
│ ├── Net.Chdk.Meta.Providers.Software.Zip.sln
│ ├── ServiceCollectionExtensions.cs
│ └── ZipSoftwareMetaProvider.cs
├── Net.Chdk.Meta.Providers.Software
│ ├── BuildMetaProvider.cs
│ ├── CategoryMetaProvider.cs
│ ├── CompilerMetaProvider.cs
│ ├── EncodingMetaProvider.cs
│ ├── Net.Chdk.Meta.Providers.Software.csproj
│ ├── Net.Chdk.Meta.Providers.Software.sln
│ ├── ServiceCollectionExtensions.cs
│ └── SourceMetaProvider.cs
├── Net.Chdk.Meta.Providers.Zip
│ ├── Net.Chdk.Meta.Providers.Zip.csproj
│ ├── Net.Chdk.Meta.Providers.Zip.sln
│ └── ZipMetaProvider.cs
├── Net.Chdk.Meta.Providers
│ ├── CameraMetaProvider.cs
│ ├── Net.Chdk.Meta.Providers.csproj
│ ├── Net.Chdk.Meta.Providers.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Writers.Camera.Core
│ ├── ICameraWriter.cs
│ ├── IInnerCameraWriter.cs
│ ├── Net.Chdk.Meta.Writers.Camera.Core.csproj
│ └── Net.Chdk.Meta.Writers.Camera.Core.sln
├── Net.Chdk.Meta.Writers.Camera.Json
│ ├── JsonCameraWriter.cs
│ ├── Net.Chdk.Meta.Writers.Camera.Json.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Writers.Camera.Props
│ ├── Net.Chdk.Meta.Writers.Camera.Props.csproj
│ ├── Net.Chdk.Meta.Writers.Camera.Props.sln
│ ├── PropsCameraWriter.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Writers.Camera
│ ├── CameraWriter.cs
│ ├── Net.Chdk.Meta.Writers.Camera.csproj
│ ├── Net.Chdk.Meta.Writers.Camera.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Meta.Writers.Json
│ ├── JsonMetaWriter.cs
│ ├── Net.Chdk.Meta.Writers.Json.csproj
│ └── Net.Chdk.Meta.Writers.Json.sln
├── Net.Chdk.Meta.Writers.Software.Core
│ ├── ISoftwareWriter.cs
│ ├── Net.Chdk.Meta.Writers.Software.Core.csproj
│ └── Net.Chdk.Meta.Writers.Software.Core.sln
├── Net.Chdk.Meta.Writers.Software.Json
│ ├── JsonSoftwareWriter.cs
│ ├── Net.Chdk.Meta.Writers.Software.Json.csproj
│ ├── Net.Chdk.Meta.Writers.Software.Json.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Model.Camera
│ ├── BaseInfo.cs
│ ├── CameraInfo.cs
│ ├── CanonInfo.cs
│ └── Net.Chdk.Model.Camera.csproj
├── Net.Chdk.Model.CameraModel
│ ├── CameraModelInfo.cs
│ └── Net.Chdk.Model.CameraModel.csproj
├── Net.Chdk.Model.Card
│ ├── CardInfo.cs
│ ├── CardInfoExtensions.cs
│ └── Net.Chdk.Model.Card.csproj
├── Net.Chdk.Model.Category
│ ├── CategoryInfo.cs
│ ├── Net.Chdk.Model.Category.csproj
│ └── Net.Chdk.Model.Category.sln
├── Net.Chdk.Model.Software
│ ├── ModuleInfo.cs
│ ├── ModulesInfo.cs
│ ├── ModulesProductInfo.cs
│ ├── Net.Chdk.Model.Software.csproj
│ ├── Net.Chdk.Model.Software.sln
│ ├── SoftwareBuildInfo.cs
│ ├── SoftwareCameraInfo.cs
│ ├── SoftwareCompilerInfo.cs
│ ├── SoftwareEncodingInfo.cs
│ ├── SoftwareHashInfo.cs
│ ├── SoftwareInfo.cs
│ ├── SoftwareProductInfo.cs
│ └── SoftwareSourceInfo.cs
├── Net.Chdk.Providers.Base
│ ├── DataProvider.cs
│ ├── Net.Chdk.Providers.Base.csproj
│ ├── Net.Chdk.Providers.Base.sln
│ └── ProviderResolver.cs
├── Net.Chdk.Providers.Boot.Core
│ ├── IBootProvider.cs
│ ├── IScriptProvider.cs
│ ├── Net.Chdk.Providers.Boot.Core.csproj
│ └── Net.Chdk.Providers.Boot.Core.sln
├── Net.Chdk.Providers.Boot
│ ├── BootProvider.cs
│ ├── BootProviderBase.cs
│ ├── IInnerBootProvider.cs
│ ├── InnerBootProvider.cs
│ ├── Net.Chdk.Providers.Boot.csproj
│ ├── Net.Chdk.Providers.Boot.sln
│ ├── ScriptProvider.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Camera.Core
│ ├── AltInfo.cs
│ ├── CameraModelsInfo.cs
│ ├── ICameraProvider.cs
│ └── Net.Chdk.Providers.Camera.Core.csproj
├── Net.Chdk.Providers.Camera
│ ├── CameraProvider.cs
│ ├── EosProductCameraProvider.cs
│ ├── IProductCameraProvider.cs
│ ├── Net.Chdk.Providers.Camera.csproj
│ ├── ProductCameraProvider.cs
│ ├── PsProductCameraProvider.cs
│ ├── ReverseCameraData.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Category.Core
│ ├── ICategoryProvider.cs
│ └── Net.Chdk.Providers.Category.Core.csproj
├── Net.Chdk.Providers.Category
│ ├── CategoryProvider.cs
│ ├── Net.Chdk.Providers.Category.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Crypto.Core
│ ├── IHashProvider.cs
│ ├── Net.Chdk.Providers.Crypto.Core.csproj
│ └── Net.Chdk.Providers.Crypto.Core.sln
├── Net.Chdk.Providers.Crypto
│ ├── HashProvider.cs
│ ├── Net.Chdk.Providers.Crypto.csproj
│ ├── Net.Chdk.Providers.Crypto.sln
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Product.Core
│ ├── IProductProvider.cs
│ ├── Net.Chdk.Providers.Product.Core.csproj
│ └── Net.Chdk.Providers.Product.Core.sln
├── Net.Chdk.Providers.Product
│ ├── Net.Chdk.Providers.Product.csproj
│ ├── Net.Chdk.Providers.Product.sln
│ ├── ProductProvider.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Software.Chdk
│ ├── ChdkSourceProvider.cs
│ ├── Net.Chdk.Providers.Software.Chdk.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Software.Core
│ ├── IModuleProvider.cs
│ ├── IProductSourceProvider.cs
│ ├── ISoftwareHashProvider.cs
│ ├── ISourceProvider.cs
│ ├── Net.Chdk.Providers.Software.Core.csproj
│ ├── Net.Chdk.Providers.Software.Core.sln
│ └── ProductSource.cs
├── Net.Chdk.Providers.Software.Ml
│ ├── MlSourceProvider.cs
│ ├── Net.Chdk.Providers.Software.Ml.csproj
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Software.Product
│ ├── Net.Chdk.Providers.Software.Product.csproj
│ ├── Net.Chdk.Providers.Software.Product.sln
│ └── ProductSourceProvider.cs
├── Net.Chdk.Providers.Software.Sdm
│ ├── Net.Chdk.Providers.Software.Sdm.csproj
│ ├── Net.Chdk.Providers.Software.Sdm.sln
│ ├── SdmSourceProvider.cs
│ └── ServiceCollectionExtensions.cs
├── Net.Chdk.Providers.Software
│ ├── IProductModuleProvider.cs
│ ├── ModuleProvider.cs
│ ├── Net.Chdk.Providers.Software.csproj
│ ├── Net.Chdk.Providers.Software.sln
│ ├── ProductModuleProvider.cs
│ ├── ServiceCollectionExtensions.cs
│ ├── SoftwareHashProvider.cs
│ └── SourceProvider.cs
├── Net.Chdk.Validators.Base
│ ├── Net.Chdk.Validators.Base.csproj
│ └── Validator.cs
├── Net.Chdk.Validators.Core
│ ├── IValidator.cs
│ └── Net.Chdk.Validators.Core.csproj
├── Net.Chdk.Validators.Software
│ ├── ModulesValidator.cs
│ ├── Net.Chdk.Validators.Software.csproj
│ ├── ServiceCollectionExtensions.cs
│ ├── SoftwareHashValidator.cs
│ └── SoftwareValidator.cs
├── Net.Chdk.Watchers.Volume.Core
│ ├── IVolumeWatcher.cs
│ └── Net.Chdk.Watchers.Volume.Core.csproj
├── Net.Chdk.Watchers.Volume
│ ├── Net.Chdk.Watchers.Volume.csproj
│ ├── ServiceCollectionExtensions.cs
│ └── VolumeWatcher.cs
└── SdmSoftwareMetaGenerator
│ ├── Data
│ ├── Category
│ │ └── PS
│ │ │ └── boot.json
│ ├── Product
│ │ └── SDM
│ │ │ ├── builds.json
│ │ │ ├── compilers.json
│ │ │ └── sources.json
│ ├── appsettings.json
│ └── products.json
│ ├── Program.cs
│ ├── SdmSoftwareMetaGenerator.csproj
│ └── SdmSoftwareMetaGenerator.sln
└── tiny.png
/small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHDKUtil/CHIMP/994816b8e1ff568e8153ef6f84e12a7be92796fb/small.png
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Actions/EjectAction.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using Chimp.Properties;
3 | using Chimp.ViewModels;
4 |
5 | namespace Chimp.Actions
6 | {
7 | sealed class EjectAction : ActionBase
8 | {
9 | public EjectAction(MainViewModel mainViewModel)
10 | : base(mainViewModel)
11 | {
12 | }
13 |
14 | public override string DisplayName => Resources.Action_Eject_Text;
15 |
16 | protected override SoftwareData Perform()
17 | {
18 | DownloadViewModel.Title = DisplayName;
19 | return null;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Assets/app.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHDKUtil/CHIMP/994816b8e1ff568e8153ef6f84e12a7be92796fb/src/CHIMP/CHIMP/Assets/app.ico
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Assets/app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHDKUtil/CHIMP/994816b8e1ff568e8153ef6f84e12a7be92796fb/src/CHIMP/CHIMP/Assets/app.png
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/CameraInfoControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for CameraInfoControl.xaml
5 | ///
6 | public partial class CameraInfoControl
7 | {
8 | public CameraInfoControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/CardInfoControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for CardInfoControl.xaml
5 | ///
6 | public partial class CardInfoControl
7 | {
8 | public CardInfoControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/EjectControl.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/EjectControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for EjectControl.xaml
5 | ///
6 | public partial class EjectControl
7 | {
8 | public EjectControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/LicensesControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for LicensesControl.xaml
5 | ///
6 | public partial class LicensesControl
7 | {
8 | public LicensesControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/SelectActionControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for SelectActionControl.xaml
5 | ///
6 | public partial class SelectActionControl
7 | {
8 | public SelectActionControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/SelectItemControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for SelectItemControl.xaml
5 | ///
6 | public partial class SelectItemControl
7 | {
8 | public SelectItemControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/SoftwareControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for SoftwareControl.xaml
5 | ///
6 | public partial class SoftwareControl
7 | {
8 | public SoftwareControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/SoftwareInfoControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for SoftwareInfoControl.xaml
5 | ///
6 | public partial class SoftwareInfoControl
7 | {
8 | public SoftwareInfoControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/SummaryControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for SummaryControl.xaml
5 | ///
6 | public partial class SummaryControl
7 | {
8 | public SummaryControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Controls/TipsControl.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Controls
2 | {
3 | ///
4 | /// Interaction logic for TipsControl.xaml
5 | ///
6 | public partial class TipsControl
7 | {
8 | public TipsControl()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Converters/BuildStatusConverter.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Properties;
2 | using System;
3 | using System.Globalization;
4 | using System.Windows.Data;
5 |
6 | namespace Chimp.Converters
7 | {
8 | public sealed class BuildStatusConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | var str = value as string;
13 | if (str == null)
14 | return null;
15 | var key = str.Length > 0 ? str.ToLowerInvariant() : "final";
16 | return Resources.ResourceManager.GetString($"Software_Status_{key}") ?? str;
17 | }
18 |
19 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
20 | {
21 | throw new NotImplementedException();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Converters/DebugConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 |
5 | namespace Chimp.Converters
6 | {
7 | sealed class DebugConverter : IValueConverter, IMultiValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10 | {
11 | return value;
12 | }
13 |
14 | public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
15 | {
16 | return values;
17 | }
18 |
19 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
20 | {
21 | return value;
22 | }
23 |
24 | public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
25 | {
26 | return new[] { value };
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Converters/FirmwareVersionConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows.Data;
4 |
5 | namespace Chimp.Converters
6 | {
7 | public class FirmwareVersionConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
10 | {
11 | if (!(value is uint v))
12 | return null;
13 | uint major1 = (v >> 24) & 0x0f;
14 | char major2 = (char)(((v >> 20) & 0x0f) + 0x30);
15 | char major3 = (char)(((v >> 16) & 0x0f) + 0x30);
16 | char rev = (char)(((v >> 8) & 0x1f) + 0x40);
17 | return $"{major1}.{major2}{major3}{rev}";
18 | }
19 |
20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21 | {
22 | throw new NotImplementedException();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Converters/FlowDirectionConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace Chimp.Converters
7 | {
8 | public sealed class FlowDirectionConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | if (value != null)
13 | culture = value as CultureInfo;
14 | if (culture == null)
15 | return null;
16 | return culture.TextInfo.IsRightToLeft
17 | ? FlowDirection.RightToLeft
18 | : FlowDirection.LeftToRight;
19 | }
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | throw new NotImplementedException();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Converters/NullToVisibilityConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 |
6 | namespace Chimp.Converters
7 | {
8 | public sealed class NullToVisibilityConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | if (parameter == null || !Enum.TryParse(parameter.ToString(), out Visibility visibility))
13 | visibility = Visibility.Collapsed;
14 | if (value == null)
15 | return visibility;
16 | return visibility == Visibility.Visible
17 | ? Visibility.Collapsed
18 | : Visibility.Visible;
19 | }
20 |
21 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
22 | {
23 | throw new NotImplementedException();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Converters/ProductVersionConverter.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 | using System.Globalization;
4 | using System.Windows.Data;
5 |
6 | namespace Chimp.Converters
7 | {
8 | public sealed class ProductVersionConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | if (!(value is SoftwareProductInfo product))
13 | return value;
14 | return product.GetVersionText();
15 | }
16 |
17 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
18 | {
19 | throw new NotImplementedException();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Converters/ResourceConverter.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Properties;
2 | using System;
3 | using System.Globalization;
4 | using System.Windows.Data;
5 |
6 | namespace Chimp.Converters
7 | {
8 | public sealed class ResourceConverter : IValueConverter
9 | {
10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
11 | {
12 | if (!(value is string key))
13 | return null;
14 | var format = parameter as string ?? "{0}";
15 | var name = string.Format(format, key);
16 | var obj = Resources.ResourceManager.GetObject(name);
17 | return obj ?? name;
18 | }
19 |
20 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
21 | {
22 | throw new NotImplementedException();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Category/EOS/boot.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": {
3 | "AUTOEXEC.BIN": null
4 | },
5 | "sizes": {
6 | "FAT": "0x200",
7 | "FAT32": "0x200"
8 | },
9 | "strings": {
10 | "FAT": {
11 | "0x2b": "EOS_DEVELOP",
12 | "0x40": "BOOTDISK"
13 | },
14 | "FAT32": {
15 | "0x47": "EOS_DEVELOP",
16 | "0x5c": "BOOTDISK"
17 | },
18 | "exFAT": {
19 | "0x82": "EOS_DEVELOP",
20 | "0x7a": "BOOTDISK",
21 | "0x1882": "EOS_DEVELOP",
22 | "0x187a": "BOOTDISK"
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Category/EOS/hash2sw.json:
--------------------------------------------------------------------------------
1 | {
2 | }
3 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/400PLUS/cameras.json:
--------------------------------------------------------------------------------
1 | {
2 | "0x80000236": {
3 | "models": [
4 | {
5 | "versions": {
6 | "1.1.1": {
7 | "version": "111"
8 | }
9 | },
10 | "names": [
11 | "Canon EOS Digital Rebel XTi",
12 | "Canon EOS 400D",
13 | "Canon EOS Kiss Digital X"
14 | ],
15 | "platform": "400D"
16 | }
17 | ],
18 | "encoding": {
19 | "name": ""
20 | },
21 | "card": {
22 | "type": "CF"
23 | },
24 | "boot": {
25 | "fs": "FAT32"
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/400PLUS/components.json:
--------------------------------------------------------------------------------
1 | {
2 | }
3 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/400PLUS/tips.json:
--------------------------------------------------------------------------------
1 | {
2 | "Eject": "CHIMP",
3 | "Led": "CHIMP",
4 | "Menu": "CHIMP",
5 | "Remove": "CHIMP"
6 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/CHDK/LANG/english.lng:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHDKUtil/CHIMP/994816b8e1ff568e8153ef6f84e12a7be92796fb/src/CHIMP/CHIMP/Data/Product/CHDK/LANG/english.lng
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/CHDK/sources.json:
--------------------------------------------------------------------------------
1 | {
2 | "CHDK_release": {
3 | "name": "CHDK",
4 | "channel": "release",
5 | "url": "http://mighty-hoernsche.de/"
6 | },
7 | "CHDK_trunk": {
8 | "name": "CHDK",
9 | "channel": "trunk",
10 | "url": "http://mighty-hoernsche.de/trunk/"
11 | },
12 | "CHDK_DE_release": {
13 | "name": "CHDK_DE",
14 | "channel": "release",
15 | "url": "http://forum.chdk-treff.de/download.php"
16 | },
17 | "CHDK_DE_trunk": {
18 | "name": "CHDK_DE",
19 | "channel": "trunk",
20 | "url": "http://forum.chdk-treff.de/download_dev.php"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/CHDK/tips.json:
--------------------------------------------------------------------------------
1 | {
2 | "Eject": "CHIMP",
3 | "Lock": "CHIMP",
4 | "Alt": "CHIMP",
5 | "Language": "CHIMP",
6 | "Menu": "CHIMP"
7 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/ML/distros.json:
--------------------------------------------------------------------------------
1 | {
2 | "ML": {
3 | "matchType": "Ml",
4 | "productType": "Ml",
5 | "baseUrl": "https://builds.magiclantern.fm/jenkins/view/ML%20Platforms/api/json?tree=jobs[lastSuccessfulBuild[url,artifacts[relativePath]]]",
6 | "language": "en"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/ML/sources.json:
--------------------------------------------------------------------------------
1 | {
2 | "ML": {
3 | "name": "ML",
4 | "channel": "",
5 | "url": "https://builds.magiclantern.fm/"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/ML/tips.json:
--------------------------------------------------------------------------------
1 | {
2 | "Eject": "CHIMP",
3 | "Led": "CHIMP",
4 | "Menu": "CHIMP",
5 | "Remove": "CHIMP"
6 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/SDM/components.json:
--------------------------------------------------------------------------------
1 | {
2 | }
3 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/SDM/distros.json:
--------------------------------------------------------------------------------
1 | {
2 | "SDM": {
3 | "matchType": "Sdm",
4 | "productType": "Sdm",
5 | "baseUrl": "http://sdm.camera/sdm/builds/",
6 | "builds": {
7 | "": "files_list.txt"
8 | },
9 | "language": "en"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/SDM/sources.json:
--------------------------------------------------------------------------------
1 | {
2 | "SDM": {
3 | "name": "SDM",
4 | "channel": "",
5 | "url": "http://sdm.camera/"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/Product/SDM/tips.json:
--------------------------------------------------------------------------------
1 | {
2 | "Eject": "CHIMP",
3 | "Lock": "CHIMP",
4 | "Alt": "CHIMP",
5 | "Menu": "CHIMP"
6 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/products.json:
--------------------------------------------------------------------------------
1 | {
2 | "CHDK": "PS",
3 | "SDM": "PS",
4 | "ML": "EOS",
5 | "400plus": "EOS"
6 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/script.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": {
3 | "script.req": "for DC_scriptdisk\n"
4 | },
5 | "sizes": {
6 | "FAT": "0x200",
7 | "FAT32": "0x200"
8 | },
9 | "strings": {
10 | "FAT": {
11 | "0x1f0": "SCRIPT"
12 | },
13 | "FAT32": {
14 | "0x1f0": "SCRIPT"
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Data/tips.json:
--------------------------------------------------------------------------------
1 | {
2 | "Eject": "CHIMP"
3 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Downloaders/BrowseDownloader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 | using Chimp.Model;
8 | using Net.Chdk.Model.Software;
9 |
10 | namespace Chimp.Downloaders
11 | {
12 | sealed class BrowseDownloader : IDownloader
13 | {
14 | public Task DownloadAsync(SoftwareCameraInfo camera, SoftwareInfo software, CancellationToken cancellationToken)
15 | {
16 | throw new NotImplementedException();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Installers/Fat32Installer.cs:
--------------------------------------------------------------------------------
1 | using Chimp.ViewModels;
2 | using Microsoft.Extensions.Logging;
3 | using Net.Chdk.Providers.Camera;
4 | using System.Threading;
5 |
6 | namespace Chimp.Installers
7 | {
8 | sealed class Fat32Installer : Installer
9 | {
10 | public Fat32Installer(MainViewModel mainViewModel, IInstallService installService, ICameraProvider cameraProvider, ILogger logger)
11 | : base(mainViewModel, installService, cameraProvider, logger)
12 | {
13 | }
14 |
15 | protected override bool InstallSingle(CancellationToken cancellationToken)
16 | {
17 | if (IsCameraFat32Bootable)
18 | return CopySingle();
19 |
20 | if (IsCardFatFormattable)
21 | return CopyFormat(FAT);
22 |
23 | return CopyPartition();
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Installers/FatInstaller.cs:
--------------------------------------------------------------------------------
1 | using Chimp.ViewModels;
2 | using Microsoft.Extensions.Logging;
3 | using Net.Chdk.Providers.Camera;
4 | using System.Threading;
5 |
6 | namespace Chimp.Installers
7 | {
8 | sealed class FatInstaller : Installer
9 | {
10 | public FatInstaller(MainViewModel mainViewModel, IInstallService installService, ICameraProvider cameraProvider, ILogger logger)
11 | : base(mainViewModel, installService, cameraProvider, logger)
12 | {
13 | }
14 |
15 | protected override bool InstallSingle(CancellationToken cancellationToken)
16 | {
17 | var switched = TestSwitchedPartitions();
18 | if (switched == null)
19 | return CopySingle();
20 |
21 | return CopyFormat(FAT32);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Installers/FormatInstaller.cs:
--------------------------------------------------------------------------------
1 | using Chimp.ViewModels;
2 | using Microsoft.Extensions.Logging;
3 | using Net.Chdk.Providers.Camera;
4 | using System.Threading;
5 |
6 | namespace Chimp.Installers
7 | {
8 | sealed class FormatInstaller : Installer
9 | {
10 | public FormatInstaller(MainViewModel mainViewModel, IInstallService installService, ICameraProvider cameraProvider, ILogger logger)
11 | : base(mainViewModel, installService, cameraProvider, logger)
12 | {
13 | }
14 |
15 | protected override bool Install(CancellationToken cancellationToken)
16 | {
17 | if (IsCameraExFatBootable)
18 | return CopyFormat(exFAT);
19 |
20 | if (IsCameraFat32Bootable)
21 | return CopyFormat(FAT32);
22 |
23 | if (IsCardFatFormattable)
24 | return CopyFormat(FAT);
25 |
26 | return CopyPartition();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Containers/IControllerContainer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Chimp
5 | {
6 | public interface IControllerContainer : IDisposable
7 | {
8 | Task GetControllerAsync(string name);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Containers/IPageContainer.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Controls;
2 |
3 | namespace Chimp
4 | {
5 | public interface IPageContainer
6 | {
7 | Page GetPage(string name);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Containers/IVolumeContainer.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp
2 | {
3 | interface IVolumeContainer
4 | {
5 | Volume GetVolume(string driveLetter);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/IAction.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | using Chimp.Model;
4 |
5 | namespace Chimp
6 | {
7 | public interface IAction
8 | {
9 | string DisplayName { get; }
10 | bool IsDefault { get; }
11 |
12 | Task PerformAsync(CancellationToken cancellationToken);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/IController.cs:
--------------------------------------------------------------------------------
1 | using Chimp.ViewModels;
2 | using System;
3 | using System.Threading.Tasks;
4 |
5 | namespace Chimp
6 | {
7 | public interface IController : IDisposable
8 | {
9 | Task InitializeAsync();
10 | Task EnterStepAsync();
11 | Task LeaveStepAsync();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/IDownloader.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using Net.Chdk.Model.Software;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace Chimp
7 | {
8 | interface IDownloader
9 | {
10 | Task DownloadAsync(SoftwareCameraInfo camera, SoftwareInfo software, CancellationToken cancellationToken);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/IInstaller.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | namespace Chimp
5 | {
6 | interface IInstaller
7 | {
8 | Task InstallAsync(CancellationToken cancellationToken);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/IServiceActivator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Chimp
4 | {
5 | public interface IServiceActivator
6 | {
7 | T Create(string typeName, Type[] argTypes, object[] argValues);
8 | T Create(Type[] types, object[] values);
9 | T Create();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IActionProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Chimp
4 | {
5 | interface IActionProvider
6 | {
7 | IEnumerable GetActions();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IBuildProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Chimp
4 | {
5 | interface IBuildProvider
6 | {
7 | string GetBuildName(SoftwareInfo softwareInfo);
8 | }
9 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IDownloadProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using Net.Chdk.Model.Software;
3 | using System.Collections.Generic;
4 | using System.Text.RegularExpressions;
5 |
6 | namespace Chimp
7 | {
8 | interface IDownloadProvider
9 | {
10 | IEnumerable GetDownloads(Match[] matches, SoftwareInfo info);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IDownloaderProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Chimp
4 | {
5 | interface IDownloaderProvider
6 | {
7 | IDownloader GetDownloader(string productName, string sourceName, SoftwareSourceInfo source);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IInstallerProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp
2 | {
3 | interface IInstallerProvider
4 | {
5 | IInstaller GetInstaller(string fileSystem);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/ILicenseProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 |
3 | namespace Chimp
4 | {
5 | interface ILicenseProvider
6 | {
7 | LicenseData[] GetLicenses();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IMatchProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System.Text.RegularExpressions;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace Chimp
7 | {
8 | interface IMatchProvider
9 | {
10 | Task GetMatchesAsync(SoftwareCameraInfo camera, string buildName, CancellationToken cancellationToken);
11 | string GetError();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IResourceProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp
2 | {
3 | interface IResourceProvider
4 | {
5 | string GetString(string id);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/ISoftwareProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Text.RegularExpressions;
2 | using Net.Chdk.Model.Software;
3 |
4 | namespace Chimp
5 | {
6 | interface ISoftwareProvider
7 | {
8 | SoftwareInfo GetSoftware(Match match);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/IStepProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Chimp
4 | {
5 | public interface IStepProvider
6 | {
7 | IEnumerable GetSteps();
8 | bool IsSkip(string name);
9 | bool IsHidden(string name);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Providers/ITipProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using System.Collections.Generic;
3 |
4 | namespace Chimp
5 | {
6 | interface ITipProvider
7 | {
8 | IEnumerable GetTips(string productText);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IBootService.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 |
3 | namespace Chimp
4 | {
5 | interface IBootService
6 | {
7 | string TestBootable(CardInfo cardInfo, string fileSystem);
8 | bool? SetBootable(CardInfo cardInfo, string fileSystem, string categoryName, bool value);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IDialogService.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp
2 | {
3 | public interface IDialogService
4 | {
5 | void ShowErrorMessage(string message);
6 | bool ShowYesNoMessage(string message, string caption);
7 | bool ShowOkCancelMessage(string message, string caption);
8 | string[] ShowOpenFileDialog(string title, string filter, bool multiselect);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IDownloadService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Chimp
6 | {
7 | interface IDownloadService
8 | {
9 | Task DownloadAsync(Uri baseUri, string path, string filePath, CancellationToken cancellationToken);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IEjectService.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp
2 | {
3 | interface IEjectService
4 | {
5 | bool Eject(string driveLetter);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IExtractService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 |
3 | namespace Chimp
4 | {
5 | interface IExtractService
6 | {
7 | string Extract(string path, string filePath, string dirPath, string tempPath, CancellationToken cancellationToken);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IFormatService.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 |
3 | namespace Chimp
4 | {
5 | interface IFormatService
6 | {
7 | bool Format(CardInfo card, string fileSystem, string label);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IInstallService.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp
2 | {
3 | interface IInstallService
4 | {
5 | void CreatePartitions();
6 | void SwitchPartitions();
7 | bool Format(string fileSystem, string label);
8 | bool SetBootable(string fileSystem);
9 | bool CopyAllFiles();
10 | bool CopyPrimaryFiles();
11 | bool CopySecondaryFiles();
12 | bool? TestSwitchedPartitions();
13 | bool ShowFormatWarning();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IMetadataService.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 | using System.Threading;
4 |
5 | namespace Chimp
6 | {
7 | interface IMetadataService
8 | {
9 | SoftwareInfo Update(SoftwareInfo software, string destPath, IProgress progress, CancellationToken token);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IPartitionService.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 |
3 | namespace Chimp
4 | {
5 | public interface IPartitionService
6 | {
7 | void CreateSinglePartition(string driveLetter);
8 | void CreatePartitions(string driveLetter);
9 | bool SwitchPartitions(string driveLetter, int part);
10 | void UpdateProperties(string driveLetter);
11 | PartitionType[] GetPartitionTypes(string driveLetter);
12 | bool? TestSwitchedPartitions(PartitionType[] partTypes);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IScriptService.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 |
3 | namespace Chimp
4 | {
5 | interface IScriptService
6 | {
7 | bool? TestScriptable(CardInfo cardInfo, string fileSystem);
8 | bool? SetScriptable(CardInfo cardInfo, string fileSystem, bool value);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Interfaces/Services/IToastService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | namespace Chimp
5 | {
6 | interface IToastService
7 | {
8 | bool IsAvailable { get; }
9 | Task ShowEjectToastAsync(string displayName);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/ActionsData.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Model
2 | {
3 | sealed class ActionData
4 | {
5 | public string Name { get; set; }
6 | public string Namespace { get; set; }
7 | }
8 |
9 | sealed class ActionsData
10 | {
11 | public ActionData[] Actions { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/Distro.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 |
5 | namespace Chimp.Model
6 | {
7 | sealed class Distro
8 | {
9 | public string MatchType { get; set; }
10 | public string ProductType { get; set; }
11 | public CultureInfo Language { get; set; }
12 | public Uri BaseUrl { get; set; }
13 | public Dictionary Builds { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/DownloadData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Chimp.Model
4 | {
5 | public sealed class DownloadData
6 | {
7 | public Uri BaseUri { get; set; }
8 | public string Path { get; set; }
9 | public string Date { get; set; }
10 | public string Size { get; set; }
11 | public string TargetPath { get; set; }
12 | public string RootDir { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/InstallersData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Chimp.Model
4 | {
5 | sealed class InstallerData
6 | {
7 | public string Type { get; set; }
8 | }
9 |
10 | sealed class InstallersData
11 | {
12 | public Dictionary Installers { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/LicensesData.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Model
2 | {
3 | sealed class LicenseData
4 | {
5 | public string Product { get; set; }
6 | public string[] Contents { get; set; }
7 | }
8 |
9 | sealed class LicensesData
10 | {
11 | public LicenseData[] Licenses { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/PartitionType.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Model
2 | {
3 | public enum PartitionType : byte
4 | {
5 | None = 0x00,
6 | PrimaryFAT = 0x01,
7 | PrimaryFAT_0 = 0x06,
8 | ExFAT = 0x07,
9 | PrimaryFAT32 = 0x0B,
10 | PrimaryFAT32_2 = 0x0C,
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/SoftwareData.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Chimp.Model
4 | {
5 | public sealed class SoftwareData
6 | {
7 | public SoftwareInfo Info { get; set; }
8 | public DownloadData[] Downloads { get; set; }
9 | public string[] Paths { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/StepsData.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Model
2 | {
3 | sealed class StepData
4 | {
5 | public string Name { get; set; }
6 | public string Namespace { get; set; }
7 | public bool Skip { get; set; }
8 | public bool Hidden { get; set; }
9 | }
10 |
11 | sealed class StepsData
12 | {
13 | public StepData[] Steps { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Model/Tip.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Model
2 | {
3 | public sealed class Tip
4 | {
5 | public string Header { get; set; }
6 | public string[] Contents { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/NOTICE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHDKUtil/CHIMP/994816b8e1ff568e8153ef6f84e12a7be92796fb/src/CHIMP/CHIMP/NOTICE
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/ActionPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/ActionPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for ActionPage.xaml
5 | ///
6 | public partial class ActionPage
7 | {
8 | public ActionPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/CardPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for CardPage.xaml
5 | ///
6 | public partial class CardPage
7 | {
8 | public CardPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/DownloadPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for DownloadPage.xaml
5 | ///
6 | public partial class DownloadPage
7 | {
8 | public DownloadPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/EjectPage.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/EjectPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Chimp.Pages
17 | {
18 | ///
19 | /// Interaction logic for EjectPage.xaml
20 | ///
21 | public partial class EjectPage : Page
22 | {
23 | public EjectPage()
24 | {
25 | InitializeComponent();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/InstallPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for Install.xaml
5 | ///
6 | public partial class InstallPage
7 | {
8 | public InstallPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/IntroPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/IntroPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for IntroPage.xaml
5 | ///
6 | public partial class IntroPage
7 | {
8 | public IntroPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/LicensesPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/LicensesPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for LicensesPage.xaml
5 | ///
6 | public partial class LicensesPage
7 | {
8 | public LicensesPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/SoftwarePage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for SoftwarePage.xaml
5 | ///
6 | public partial class SoftwarePage
7 | {
8 | public SoftwarePage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/SummaryPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Pages/SummaryPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Pages
2 | {
3 | ///
4 | /// Interaction logic for SummaryPage.xaml
5 | ///
6 | public partial class SummaryPage
7 | {
8 | public SummaryPage()
9 | {
10 | InitializeComponent();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Action/BrowseActionProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Actions;
2 | using Chimp.ViewModels;
3 | using System.Collections.Generic;
4 |
5 | namespace Chimp.Providers.Action
6 | {
7 | sealed class BrowseActionProvider : ActionProvider
8 | {
9 | public BrowseActionProvider(MainViewModel mainViewModel, IServiceActivator serviceActivator)
10 | : base(mainViewModel, serviceActivator)
11 | {
12 | }
13 |
14 | public override IEnumerable GetActions()
15 | {
16 | if (SoftwareViewModel.SelectedItem == null)
17 | yield return ServiceActivator.Create();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Action/EjectActionProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Actions;
2 | using Chimp.ViewModels;
3 | using System.Collections.Generic;
4 |
5 | namespace Chimp.Providers.Action
6 | {
7 | sealed class EjectActionProvider : ActionProvider
8 | {
9 | public EjectActionProvider(MainViewModel mainViewModel, IServiceActivator serviceActivator)
10 | : base(mainViewModel, serviceActivator)
11 | {
12 | }
13 |
14 | public override IEnumerable GetActions()
15 | {
16 | if (EjectViewModel.IsEject)
17 | yield return ServiceActivator.Create();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Action/UpdateActionProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Actions;
2 | using Chimp.ViewModels;
3 | using Net.Chdk.Model.Software;
4 | using Net.Chdk.Providers.Camera;
5 | using Net.Chdk.Providers.Software;
6 | using System.Collections.Generic;
7 |
8 | namespace Chimp.Providers.Action
9 | {
10 | sealed class UpdateActionProvider : InstallActionProvider
11 | {
12 | public UpdateActionProvider(MainViewModel mainViewModel, ISourceProvider sourceProvider, ICameraProvider cameraProvider, IServiceActivator serviceActivator)
13 | : base(mainViewModel, sourceProvider, cameraProvider, serviceActivator)
14 | {
15 | }
16 |
17 | protected override IEnumerable GetProducts()
18 | {
19 | var product = SoftwareViewModel.SelectedItem?.Info.Product;
20 | if (product != null)
21 | yield return product;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Build/BuildProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Chimp.Providers.Build
4 | {
5 | abstract class BuildProvider : IBuildProvider
6 | {
7 | public virtual string GetBuildName(SoftwareInfo softwareInfo)
8 | {
9 | return string.Empty;
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Build/ChdkBuildProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 |
4 | namespace Chimp.Providers.Build
5 | {
6 | sealed class ChdkBuildProvider : BuildProvider
7 | {
8 | private SoftwareSourceInfo Source { get; }
9 |
10 | public ChdkBuildProvider(SoftwareSourceInfo source)
11 | {
12 | Source = source;
13 | }
14 |
15 | public override string GetBuildName(SoftwareInfo software)
16 | {
17 | var product = software?.Product;
18 | var source = software?.Source;
19 | if (product == null || source == null)
20 | return "full";
21 | return product.Version?.MinorRevision >= 0 && source.Name.Equals(Source.Name, StringComparison.InvariantCulture)
22 | ? string.Empty
23 | : "full";
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Build/MlBuildProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Providers.Build
2 | {
3 | sealed class MlBuildProvider : BuildProvider
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Build/SdmBuildProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.Providers.Build
2 | {
3 | sealed class SdmBuildProvider : BuildProvider
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Downloads/ChdkDownloadProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Chimp.Providers.Downloads
4 | {
5 | sealed class ChdkDownloadProvider : DownloadProvider
6 | {
7 | public ChdkDownloadProvider(Uri baseUri)
8 | : base(baseUri)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Downloads/MlDownloadProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.RegularExpressions;
3 |
4 | namespace Chimp.Providers.Downloads
5 | {
6 | sealed class MlDownloadProvider : DownloadProvider
7 | {
8 | public MlDownloadProvider(Uri baseUri)
9 | : base(baseUri)
10 | {
11 | }
12 |
13 | protected override Uri GetBaseUri(Match match)
14 | {
15 | var url = match.Groups["url"].Value;
16 | return new Uri($"{url}artifact/");
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/LicenseProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using Microsoft.Extensions.Options;
3 |
4 | namespace Chimp.Providers
5 | {
6 | sealed class LicenseProvider : ILicenseProvider
7 | {
8 | #region Fields
9 |
10 | private LicensesData LicensesData { get; }
11 |
12 | #endregion
13 |
14 | #region Constructor
15 |
16 | public LicenseProvider(IOptions options)
17 | {
18 | LicensesData = options.Value;
19 | }
20 |
21 | #endregion
22 |
23 | #region ILicenseProvider Members
24 |
25 | public LicenseData[] GetLicenses()
26 | {
27 | return LicensesData.Licenses;
28 | }
29 |
30 | #endregion
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Software/ChdkSoftwareProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using Net.Chdk.Providers.Product;
3 | using System;
4 | using System.Globalization;
5 | using System.Text.RegularExpressions;
6 |
7 | namespace Chimp.Providers.Software
8 | {
9 | sealed class ChdkSoftwareProvider : SoftwareProvider
10 | {
11 | public ChdkSoftwareProvider(IProductProvider productProvider, SoftwareSourceInfo source, CultureInfo language)
12 | : base(productProvider, source, language)
13 | {
14 | }
15 |
16 | protected override string ProductName => "CHDK";
17 |
18 | protected override Version GetVersion(Match match)
19 | {
20 | var version = match.Groups["version"].Value;
21 | var build = match.Groups["build"].Value;
22 | return Version.Parse($"{version}.{build}");
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Software/SdmSoftwareProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using Net.Chdk.Providers.Product;
3 | using System;
4 | using System.Globalization;
5 | using System.Text.RegularExpressions;
6 |
7 | namespace Chimp.Providers.Software
8 | {
9 | sealed class SdmSoftwareProvider : SoftwareProvider
10 | {
11 | public SdmSoftwareProvider(IProductProvider productProvider, SoftwareSourceInfo source, CultureInfo language)
12 | : base(productProvider, source, language)
13 | {
14 | }
15 |
16 | protected override string ProductName => "SDM";
17 |
18 | protected override Version GetVersion(Match match)
19 | {
20 | var version = match.Groups["version"].Value;
21 | return Version.Parse(version);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Tips/LedTipProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using Chimp.Properties;
3 | using Chimp.ViewModels;
4 | using System.Collections.Generic;
5 |
6 | namespace Chimp.Providers.Tips
7 | {
8 | sealed class LedTipProvider : TipProvider
9 | {
10 | public LedTipProvider(MainViewModel mainViewModel)
11 | : base(mainViewModel)
12 | {
13 | }
14 |
15 | public override IEnumerable GetTips(string productText)
16 | {
17 | yield return new Tip
18 | {
19 | Header = Resources.Summary_EOS_Led_Header,
20 | Contents = new[]
21 | {
22 | Resources.Summary_EOS_Led_Text
23 | }
24 | };
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Providers/Tips/RemoveTipProvider.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using Chimp.Properties;
3 | using Chimp.ViewModels;
4 | using System.Collections.Generic;
5 |
6 | namespace Chimp.Providers.Tips
7 | {
8 | sealed class RemoveTipProvider : TipProvider
9 | {
10 | public RemoveTipProvider(MainViewModel mainViewModel)
11 | : base(mainViewModel)
12 | {
13 | }
14 |
15 | public override IEnumerable GetTips(string productText)
16 | {
17 | yield return new Tip
18 | {
19 | Header = Resources.Summary_Remove_Header,
20 | Contents = new[]
21 | {
22 | string.Format(Resources.Summary_EOS_Remove_Format, productText),
23 | Resources.Summary_EOS_Remove_2_Text,
24 | Resources.Summary_EOS_Remove_3_Text,
25 | }
26 | };
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Resources/intro_tips.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "header": "SD cards only",
4 | "contents": [ "MMC cards are unsupported (a microSD with an adapter is OK)." ]
5 | },
6 | {
7 | "header": "Ready to lock",
8 | "contents": [ "The card must have a lock switch (barring a microSD camera)." ]
9 | },
10 | {
11 | "header": "Take a picture",
12 | "contents": [ "At least one picture taken with the camera must be present." ]
13 | },
14 | {
15 | "header": "Use a card reader",
16 | "contents": [ "Connecting the camera with a cable is unsupported." ]
17 | },
18 | {
19 | "header": "Back it up",
20 | "contents": [ "It is recommended that you back up all data present of your card." ]
21 | },
22 | {
23 | "header": "Disclaimer",
24 | "contents": [ "Neither CHIMP nor any of the hacks are endorsed by or affiliated with Canon."]
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Resources/intro_tips_fr.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "header": "Cartes SD seulement",
4 | "contents": [ "Les cartes MMC ne sont pas supportées (sauf avec un adpatateur SD)." ]
5 | },
6 | {
7 | "header": "Prêt à verrouiller",
8 | "contents": [ "La carte doit avoir un verrou (exluant les microSD)." ]
9 | },
10 | {
11 | "header": "Prendre une photo",
12 | "contents": [ "Au moins une image prise avec l'appareil doit être présente." ]
13 | },
14 | {
15 | "header": "Utiliser un lecteur de carte",
16 | "contents": [ "La connexion de l'appareil par cable n'est pas prévu." ]
17 | },
18 | {
19 | "header": "Sauvegarde",
20 | "contents": [ "Il est recommandé de sauvegarder les données sur la carte." ]
21 | },
22 | {
23 | "header": "Mise en garde",
24 | "contents": [ "Ni CHIMP ni les hacks ne sont supportés ou recommandés par Canon."]
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Resources/intro_tips_ru.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "header": "Только SD",
4 | "contents": [ "Карты MMC не поддерживаются (microSD с переходником работают)." ]
5 | },
6 | {
7 | "header": "Защита от записи",
8 | "contents": [ "Карта должна иметь переключатель блокировки (за исключением камер microSD)." ]
9 | },
10 | {
11 | "header": "Сделайте снимок",
12 | "contents": [ "Карта должна содержать как минимум один снимок." ]
13 | },
14 | {
15 | "header": "Используйте кардридер",
16 | "contents": [ "Кабельное подключение не поддерживается." ]
17 | },
18 | {
19 | "header": "Сохраните копию",
20 | "contents": [ "Рекомендуется сохранить копию всех данных, содержащихся на карте." ]
21 | },
22 | {
23 | "header": "Внимание",
24 | "contents": [ "Ни CHIMP, ни устанавливаемое им стороннее ПО никак не связаны с Canon."]
25 | }
26 | ]
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/ActionItemViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | sealed class ActionItemViewModel
4 | {
5 | public string DisplayName { get; set; }
6 | public IAction Action { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/ActionViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | sealed class ActionViewModel : ItemsViewModel
4 | {
5 | public string Title { get; set; }
6 |
7 | public static ActionViewModel Get(MainViewModel mainViewModel) => mainViewModel.Get("Action");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/CameraItemViewModel.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.CameraModel;
2 |
3 | namespace Chimp.ViewModels
4 | {
5 | public sealed class CameraItemViewModel
6 | {
7 | public string DisplayName { get; set; }
8 | public CameraModelInfo Model { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/CameraViewModel.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 |
3 | namespace Chimp.ViewModels
4 | {
5 | sealed class CameraViewModel : ItemsViewModel
6 | {
7 | public static CameraViewModel Get(MainViewModel mainViewModel) => mainViewModel.Get("Camera");
8 |
9 | private string _Error;
10 | public string Error
11 | {
12 | get { return _Error; }
13 | set { SetProperty(ref _Error, value); }
14 | }
15 |
16 | private CameraInfo _Info;
17 | public CameraInfo Info
18 | {
19 | get { return _Info; }
20 | set { SetProperty(ref _Info, value); }
21 | }
22 |
23 | public string CardType { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/CardItemViewModel.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 | using Net.Chdk.Model.Card;
3 |
4 | namespace Chimp.ViewModels
5 | {
6 | public sealed class CardItemViewModel
7 | {
8 | public CardInfo Info { get; set; }
9 | public string DisplayName { get; set; }
10 | public string Bootable { get; set; }
11 | public bool? Scriptable { get; set; }
12 | public PartitionType[] PartitionTypes { get; set; }
13 | public bool? Switched { get; set; }
14 | public string FileSystem { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/EjectViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | sealed class EjectViewModel : ViewModel
4 | {
5 | public static EjectViewModel Get(MainViewModel mainViewModel) => mainViewModel.Get("Eject");
6 |
7 | public string Title { get; set; }
8 |
9 | private bool _IsEject;
10 | public bool IsEject
11 | {
12 | get { return _IsEject; }
13 | set { SetProperty(ref _IsEject, value); }
14 | }
15 |
16 | private bool _IsCompleted;
17 | public bool IsCompleted
18 | {
19 | get { return _IsCompleted; }
20 | set { SetProperty(ref _IsCompleted, value); }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/IntroViewModel.cs:
--------------------------------------------------------------------------------
1 | using Chimp.Model;
2 |
3 | namespace Chimp.ViewModels
4 | {
5 | public sealed class IntroViewModel : ViewModel
6 | {
7 | public string Title { get; set; }
8 | public string Message { get; set; }
9 | public Tip[] Tips { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/ItemsViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | abstract class ItemsViewModel: ViewModel
4 | {
5 | private TItemViewModel[] _Items;
6 | public TItemViewModel[] Items
7 | {
8 | get { return _Items; }
9 | set { SetProperty(ref _Items, value); }
10 | }
11 |
12 | private TItemViewModel _SelectedItem;
13 | public TItemViewModel SelectedItem
14 | {
15 | get { return _SelectedItem; }
16 | set { SetProperty(ref _SelectedItem, value); }
17 | }
18 |
19 | private bool _IsSelect;
20 | public bool IsSelect
21 | {
22 | get { return _IsSelect; }
23 | set { SetProperty(ref _IsSelect, value); }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/LicensesItemViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | public sealed class LicensesItemViewModel : ViewModel
4 | {
5 | public string Product { get; set; }
6 |
7 | public string[] Contents { get; set; }
8 |
9 | private bool _IsAccepted;
10 | public bool IsAccepted
11 | {
12 | get { return _IsAccepted; }
13 | set { SetProperty(ref _IsAccepted, value); }
14 | }
15 |
16 | private bool _IsExpanded;
17 | public bool IsExpanded
18 | {
19 | get { return _IsExpanded; }
20 | set { SetProperty(ref _IsExpanded, value); }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/LicensesViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | public sealed class LicensesViewModel : ViewModel
4 | {
5 | public string Title { get; set; }
6 | public LicensesItemViewModel[] Licenses { get; set; }
7 |
8 | private bool _IsAllAccepted;
9 | public bool IsAllAccepted
10 | {
11 | get { return _IsAllAccepted; }
12 | set { SetProperty(ref _IsAllAccepted, value); }
13 | }
14 |
15 | private bool _IsAllRejected;
16 | public bool IsAllRejected
17 | {
18 | get { return _IsAllRejected; }
19 | set { SetProperty(ref _IsAllRejected, value); }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/ModulesItemViewModel.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Chimp.ViewModels
4 | {
5 | sealed class ModulesItemViewModel
6 | {
7 | public string DisplayName { get; set; }
8 | public string Name { get; set; }
9 | public ModuleInfo Info { get; set; }
10 | public string ToolTip { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/ModulesViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | sealed class ModulesViewModel
4 | {
5 | public ModulesItemViewModel[] Items { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/SoftwareItemViewModel.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Chimp.ViewModels
4 | {
5 | sealed class SoftwareItemViewModel
6 | {
7 | public string DisplayName { get; set; }
8 | public SoftwareInfo Info { get; set; }
9 | public ModulesViewModel Modules { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/SoftwareViewModel.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Chimp.ViewModels
4 | {
5 | sealed class SoftwareViewModel : ItemsViewModel
6 | {
7 | public static SoftwareViewModel Get(MainViewModel mainViewModel) => mainViewModel.Get("Software");
8 |
9 | private string _Title;
10 | public string Title
11 | {
12 | get { return _Title; }
13 | set { SetProperty(ref _Title, value); }
14 | }
15 |
16 | private bool _IsCompleted;
17 | public bool IsCompleted
18 | {
19 | get { return _IsCompleted; }
20 | set { SetProperty(ref _IsCompleted, value); }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/ViewModels/StepItemViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Chimp.ViewModels
2 | {
3 | public sealed class StepItemViewModel : ViewModel
4 | {
5 | public string Name { get; set; }
6 |
7 | private bool _IsVisible;
8 | public bool IsVisible
9 | {
10 | get { return _IsVisible; }
11 | set { SetProperty(ref _IsVisible, value); }
12 | }
13 |
14 | private bool _IsSelected;
15 | public bool IsSelected
16 | {
17 | get { return _IsSelected; }
18 | set { SetProperty(ref _IsSelected, value); }
19 | }
20 |
21 | private bool _IsSkipped;
22 | public bool IsSkipped
23 | {
24 | get { return _IsSkipped; }
25 | set { SetProperty(ref _IsSkipped, value); }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/fat32format.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHDKUtil/CHIMP/994816b8e1ff568e8153ef6f84e12a7be92796fb/src/CHIMP/CHIMP/fat32format.exe
--------------------------------------------------------------------------------
/src/CHIMP/CHIMP/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CHDKUtil/CHIMP/994816b8e1ff568e8153ef6f84e12a7be92796fb/src/CHIMP/CHIMP/logo.png
--------------------------------------------------------------------------------
/src/CameraMetaGenerator/Data/products.json:
--------------------------------------------------------------------------------
1 | {
2 | "CHDK": "PS",
3 | "SDM": "PS",
4 | "ML": "EOS",
5 | "400plus": "EOS"
6 | }
7 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Core/CultureInfoExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace Net.Chdk
4 | {
5 | public static class CultureInfoExtensions
6 | {
7 | public static bool IsCurrentUICulture(this CultureInfo culture)
8 | {
9 | for (var currentCulture = CultureInfo.CurrentUICulture; currentCulture != null; currentCulture = currentCulture.Parent)
10 | {
11 | if (currentCulture.Equals(culture))
12 | return true;
13 | if (currentCulture.IsNeutralCulture)
14 | return false;
15 | }
16 | return false;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Core/Directories.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk
2 | {
3 | public static class Directories
4 | {
5 | public const string Images = "DCIM";
6 | public const string Metadata = "_HDKMETA";
7 |
8 | public const string Data = "Data";
9 | public const string Category = "Category";
10 | public const string Product = "Product";
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Core/Files.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk
2 | {
3 | public static class Files
4 | {
5 | public static class Metadata
6 | {
7 | public const string Software = "SOFTWARE.JSN";
8 | public const string Modules = "MODULES.JSN";
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Core/Net.Chdk.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard1.0;net461
5 | CHIMP core
6 | Net.Chdk
7 |
8 |
9 |
10 | 0.4.0
11 | alpha
12 | CHIMP
13 | Dmitry Shechtman
14 | Copyright © 2017 Dmitry Shechtman
15 |
16 |
17 |
18 | true
19 |
20 |
21 |
22 |
23 | true
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Core/StringExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk
2 | {
3 | public static class StringExtensions
4 | {
5 | public static string TrimStart(this string str, string prefix)
6 | {
7 | return str.StartsWith(prefix)
8 | ? str.Substring(prefix.Length)
9 | : str;
10 | }
11 |
12 | public static string TrimEnd(this string str, string suffix)
13 | {
14 | return str.EndsWith(suffix)
15 | ? str.Substring(0, str.Length - suffix.Length)
16 | : str;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Camera.Core/CameraDetectionException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Net.Chdk.Detectors.Camera
4 | {
5 | public sealed class CameraDetectionException : Exception
6 | {
7 | public CameraDetectionException(Exception innerException)
8 | : base(innerException.Message, innerException)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Camera.Core/ICameraDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 | using Net.Chdk.Model.Card;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.Camera
7 | {
8 | public interface ICameraDetector
9 | {
10 | CameraInfo GetCamera(CardInfo cardInfo, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Camera.Core/IFileCameraDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 |
3 | namespace Net.Chdk.Detectors.Camera
4 | {
5 | public interface IFileCameraDetector
6 | {
7 | CameraInfo GetCamera(string filePath);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Camera.Core/IFilePatternProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Detectors.Camera
2 | {
3 | public interface IFilePatternProvider
4 | {
5 | string[] Patterns { get; }
6 | string PatternsDescription { get; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Camera/AllFileSystemCameraDetector.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using Net.Chdk.Model.Camera;
3 |
4 | namespace Net.Chdk.Detectors.Camera
5 | {
6 | sealed class AllFileSystemCameraDetector : FileSystemCameraDetectorBase
7 | {
8 | public AllFileSystemCameraDetector(IFileCameraDetector fileCameraDetector, ILoggerFactory loggerFactory)
9 | : base(fileCameraDetector, loggerFactory)
10 | {
11 | }
12 |
13 | public override string[] Patterns => new[]
14 | {
15 | "*.JPG",
16 | "*.THM",
17 | "*.CR2",
18 | "*.CR3",
19 | "*.CRM",
20 | };
21 |
22 | public override string PatternsDescription => "CompatibleImages";
23 |
24 | protected override bool IsValid(CameraInfo camera) => camera?.Canon != null;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Camera/IInnerCameraDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 | using Net.Chdk.Model.Card;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.Camera
7 | {
8 | public interface IInnerCameraDetector
9 | {
10 | CameraInfo GetCamera(CardInfo cardInfo, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.CameraModel.Core/CameraModels.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 | using Net.Chdk.Model.CameraModel;
3 |
4 | namespace Net.Chdk.Detectors.CameraModel
5 | {
6 | public sealed class CameraModels
7 | {
8 | public CameraInfo Info { get; set; }
9 | public CameraModelInfo[] Models { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.CameraModel.Core/ICameraModelDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 | using Net.Chdk.Model.Software;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.CameraModel
7 | {
8 | public interface ICameraModelDetector
9 | {
10 | CameraModels GetCameraModels(CardInfo cardInfo, SoftwareInfo softwareInfo, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.CameraModel.Core/IFileCameraModelDetector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Net.Chdk.Detectors.CameraModel
5 | {
6 | public interface IFileCameraModelDetector
7 | {
8 | CameraModels GetCameraModels(string filePath, IProgress progress, CancellationToken token);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.CameraModel/IInnerCameraModelDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 | using Net.Chdk.Model.CameraModel;
3 | using Net.Chdk.Model.Card;
4 | using System;
5 | using System.Threading;
6 |
7 | namespace Net.Chdk.Detectors.CameraModel
8 | {
9 | public interface IInnerCameraModelDetector
10 | {
11 | CameraModelInfo[] GetCameraModels(CardInfo cardInfo, CameraInfo cameraInfo, IProgress progress, CancellationToken token);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.CameraModel/IOuterCameraModelDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 | using Net.Chdk.Model.Software;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.CameraModel
7 | {
8 | public interface IOuterCameraModelDetector
9 | {
10 | CameraModels GetCameraModels(CardInfo cardInfo, SoftwareInfo softwareInfo, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Card.Core/ICardDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 |
3 | namespace Net.Chdk.Detectors.Card
4 | {
5 | public interface ICardDetector
6 | {
7 | CardInfo[] GetCards();
8 | CardInfo GetCard(string driveLetter);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Card/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Detectors.Card
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCardDetector(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Chdk/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Detectors.Software.Chdk
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddChdkSoftwareDetector(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 |
13 | public static IServiceCollection AddChdkProductDetector(this IServiceCollection serviceCollection)
14 | {
15 | return serviceCollection
16 | .AddSingleton();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IBinarySoftwareDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 | using System.Threading;
4 |
5 | namespace Net.Chdk.Detectors.Software
6 | {
7 | public interface IBinarySoftwareDetector
8 | {
9 | SoftwareInfo GetSoftware(string basePath, string categoryName, IProgress progress, CancellationToken token);
10 | SoftwareInfo GetSoftware(byte[] buffer, IProgress progress, CancellationToken token);
11 | bool UpdateSoftware(SoftwareInfo software, byte[] buffer);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IFileSystemModulesDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 | using System.Threading;
4 |
5 | namespace Net.Chdk.Detectors.Software
6 | {
7 | public interface IFileSystemModulesDetector
8 | {
9 | ModulesInfo GetModules(SoftwareInfo software, string basePath, IProgress progress, CancellationToken token);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IInnerBinarySoftwareDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 | using System.Threading;
4 |
5 | namespace Net.Chdk.Detectors.Software
6 | {
7 | public interface IInnerBinarySoftwareDetector
8 | {
9 | SoftwareInfo GetSoftware(string basePath, string categoryName, IProgress progress, CancellationToken token);
10 | SoftwareInfo GetSoftware(byte[] buffer, IProgress progress, CancellationToken token);
11 | bool UpdateSoftware(SoftwareInfo software, byte[] buffer);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IMetadataModulesDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 | using System.Threading;
4 |
5 | namespace Net.Chdk.Detectors.Software
6 | {
7 | public interface IMetadataModulesDetector
8 | {
9 | ModulesInfo GetModules(string basePath, string basePath2, SoftwareInfo software, IProgress progress, CancellationToken token);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IMetadataSoftwareDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Category;
2 | using Net.Chdk.Model.Software;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.Software
7 | {
8 | public interface IMetadataSoftwareDetector
9 | {
10 | SoftwareInfo GetSoftware(string basePath, CategoryInfo category, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IModulesDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 | using Net.Chdk.Model.Software;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.Software
7 | {
8 | public interface IModulesDetector
9 | {
10 | ModulesInfo GetModules(CardInfo card, CardInfo card2, SoftwareInfo software, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IProductBinaryModuleDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Detectors.Software
4 | {
5 | public interface IProductBinaryModuleDetector
6 | {
7 | string ProductName { get; }
8 | byte[] Bytes { get; }
9 | ModuleInfo GetModule(SoftwareInfo software, byte[] buffer, int index, string hashName);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IProductBinarySoftwareDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Detectors.Software
4 | {
5 | public interface IProductBinarySoftwareDetector
6 | {
7 | string CategoryName { get; }
8 | string ProductName { get; }
9 | byte[] Bytes { get; }
10 | SoftwareInfo GetSoftware(byte[] buffer, int index);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/IProductDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 | using Net.Chdk.Model.Software;
3 |
4 | namespace Net.Chdk.Detectors.Software
5 | {
6 | public interface IProductDetector
7 | {
8 | SoftwareProductInfo GetProduct(CardInfo cardInfo);
9 | string CategoryName { get; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Core/ISoftwareDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 | using Net.Chdk.Model.Software;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.Software
7 | {
8 | public interface ISoftwareDetector
9 | {
10 | SoftwareInfo[] GetSoftware(CardInfo cardInfo, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Fhp/FhpProductDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Detectors.Software.Product;
2 | using Net.Chdk.Providers.Boot;
3 | using Net.Chdk.Providers.Product;
4 | using System;
5 | using System.Globalization;
6 |
7 | namespace Net.Chdk.Detectors.Software.Fhp
8 | {
9 | sealed class FhpProductDetector : ProductDetector
10 | {
11 | public FhpProductDetector(IProductProvider productProvider, IBootProvider bootProvider)
12 | : base(productProvider, bootProvider)
13 | {
14 | }
15 |
16 | protected override string ProductName => "400plus";
17 |
18 | protected override Version GetVersion(string rootPath)
19 | {
20 | return null;
21 | }
22 |
23 | protected override CultureInfo GetLanguage(string rootPath)
24 | {
25 | return GetCultureInfo("en");
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Fhp/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Detectors.Software.Fhp
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddFhpSoftwareDetector(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 |
13 | public static IServiceCollection AddFhpProductDetector(this IServiceCollection serviceCollection)
14 | {
15 | return serviceCollection
16 | .AddSingleton();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Ml/MlProductDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Detectors.Software.Product;
2 | using Net.Chdk.Providers.Boot;
3 | using Net.Chdk.Providers.Product;
4 | using System;
5 | using System.Globalization;
6 |
7 | namespace Net.Chdk.Detectors.Software.Ml
8 | {
9 | sealed class MlProductDetector : ProductDetector
10 | {
11 | public MlProductDetector(IProductProvider productProvider, IBootProvider bootProvider)
12 | : base(productProvider, bootProvider)
13 | {
14 | }
15 |
16 | protected override string ProductName => "ML";
17 |
18 | protected override Version GetVersion(string rootPath)
19 | {
20 | return null;
21 | }
22 |
23 | protected override CultureInfo GetLanguage(string rootPath)
24 | {
25 | return GetCultureInfo("en");
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Product/ProductDetectorBase.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Globalization;
3 |
4 | namespace Net.Chdk.Detectors.Software.Product
5 | {
6 | public abstract class ProductDetectorBase
7 | {
8 | private static readonly Dictionary CultureInfos = new Dictionary();
9 |
10 | protected static CultureInfo GetCultureInfo(string name)
11 | {
12 | if (!(CultureInfos.TryGetValue(name, out CultureInfo value)))
13 | {
14 | value = new CultureInfo(name);
15 | CultureInfos.Add(name, value);
16 | }
17 | return value;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Sdm/SdmSoftwareDetectorBase.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Detectors.Software.Product;
2 | using Net.Chdk.Model.Software;
3 | using Net.Chdk.Providers.Product;
4 | using Net.Chdk.Providers.Software;
5 |
6 | namespace Net.Chdk.Detectors.Software.Sdm
7 | {
8 | abstract class SdmSoftwareDetectorBase : ProductBinarySoftwareDetector
9 | {
10 | protected SdmSoftwareDetectorBase(IProductProvider productProvider, ISourceProvider sourceProvider)
11 | : base(productProvider, sourceProvider)
12 | {
13 | }
14 |
15 | public sealed override string ProductName => "SDM";
16 |
17 | protected override SoftwareBuildInfo GetBuild(string[] strings)
18 | {
19 | return new SoftwareBuildInfo();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software.Sdm/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Detectors.Software.Sdm
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddSdmSoftwareDetector(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 |
13 | public static IServiceCollection AddSdmProductDetector(this IServiceCollection serviceCollection)
14 | {
15 | return serviceCollection
16 | .AddSingleton();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software/DerivedModuleDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Detectors.Software
5 | {
6 | sealed class DerivedModuleDetector : IInnerModuleDetector
7 | {
8 | public ModuleInfo GetModule(SoftwareInfo software, byte[] buffer, string hashName)
9 | {
10 | return new ModuleInfo
11 | {
12 | Created = software.Product.Created,
13 | Changeset = software.Build?.Changeset,
14 | Hash = GetHash(hashName),
15 | };
16 | }
17 |
18 | private static SoftwareHashInfo GetHash(string hashName)
19 | {
20 | return new SoftwareHashInfo
21 | {
22 | Name = hashName,
23 | Values = new Dictionary(),
24 | };
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software/IInnerModuleDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Detectors.Software
4 | {
5 | public interface IInnerModuleDetector
6 | {
7 | ModuleInfo GetModule(SoftwareInfo software, byte[] buffer, string hashName);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software/IInnerModulesDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 | using Net.Chdk.Model.Software;
3 | using System;
4 | using System.Threading;
5 |
6 | namespace Net.Chdk.Detectors.Software
7 | {
8 | interface IInnerModulesDetector
9 | {
10 | ModulesInfo GetModules(CardInfo card, CardInfo card2, SoftwareInfo software, IProgress progress, CancellationToken token);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software/IInnerSoftwareDetector.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Card;
2 | using Net.Chdk.Model.Category;
3 | using Net.Chdk.Model.Software;
4 | using System;
5 | using System.Threading;
6 |
7 | namespace Net.Chdk.Detectors.Software
8 | {
9 | interface IInnerSoftwareDetector
10 | {
11 | SoftwareInfo GetSoftware(CardInfo cardInfo, CategoryInfo category, IProgress progress, CancellationToken token);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software/PsBinarySoftwareDetector.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using Microsoft.Extensions.Options;
3 | using Net.Chdk.Encoders.Binary;
4 | using Net.Chdk.Providers.Boot;
5 | using Net.Chdk.Providers.Camera;
6 | using Net.Chdk.Providers.Software;
7 | using System.Collections.Generic;
8 |
9 | namespace Net.Chdk.Detectors.Software
10 | {
11 | abstract class PsBinarySoftwareDetector : BinarySoftwareDetectorBase
12 | {
13 | protected PsBinarySoftwareDetector(IEnumerable softwareDetectors, IBinaryDecoder binaryDecoder, IBootProvider bootProvider, ICameraProvider cameraProvider, ISoftwareHashProvider hashProvider, IOptions settings, ILogger logger)
14 | : base(softwareDetectors, binaryDecoder, bootProvider, cameraProvider, hashProvider, settings, logger)
15 | {
16 | }
17 |
18 | protected override string CategoryName => "PS";
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Detectors.Software/SoftwareDetectorSettings.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Detectors.Software
2 | {
3 | public sealed class SoftwareDetectorSettings
4 | {
5 | public string HashName { get; set; } = "sha256";
6 | public bool ShuffleOffsets { get; set; } = true;
7 | public int MaxThreads { get; set; } = 0;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Encoders.Binary.Core/IBinaryDecoder.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Encoders.Binary
2 | {
3 | public interface IBinaryDecoder
4 | {
5 | bool ValidatePrefix(byte[] encBuffer, int size, byte[] prefix);
6 | void Decode(byte[] encBuffer, byte[] decBuffer, uint offsets);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Encoders.Binary.Core/IBinaryEncoder.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Encoders.Binary
2 | {
3 | public interface IBinaryEncoder
4 | {
5 | void Encode(byte[] decBuffer, byte[] encBuffer, uint offsets);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Encoders.Binary/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Encoders.Binary
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddBinaryEncoder(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 |
13 | public static IServiceCollection AddBinaryDecoder(this IServiceCollection serviceCollection)
14 | {
15 | return serviceCollection
16 | .AddSingleton();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform.Core/IInnerPlatformGenerator.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Generators.Platform
2 | {
3 | public interface IInnerPlatformGenerator
4 | {
5 | string GetPlatform(uint modelId, string[] models);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform.Core/IPlatformGenerator.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Generators.Platform
2 | {
3 | public interface IPlatformGenerator
4 | {
5 | string GetPlatform(uint modelId, string[] models);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform.Eos/EosPsPlatformGenerator.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace Net.Chdk.Meta.Generators.Platform.Eos
5 | {
6 | sealed class EosPsPlatformGenerator : InnerPlatformGenerator
7 | {
8 | private const uint MaxModelId = 0x1000000;
9 |
10 | protected override IEnumerable PreGenerate(uint modelId, string source)
11 | {
12 | if (modelId > MaxModelId)
13 | return null;
14 |
15 | var split = source.Split(' ');
16 | if (!Keyword.Equals(split[0]))
17 | return null;
18 |
19 | split = AdaptMark(split);
20 |
21 | return split.Skip(1);
22 | }
23 |
24 | protected override string Keyword => "PowerShot";
25 |
26 | protected override string[] Suffixes => new[] { "HS" };
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform.Eos/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Generators.Platform.Eos
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddEosPlatformGenerator(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton()
11 | .AddSingleton();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform.Ps/PsEosPlatformGenerator.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace Net.Chdk.Meta.Generators.Platform.Ps
5 | {
6 | sealed class PsEosPlatformGenerator : PsPlatformGeneratorBase
7 | {
8 | protected override IEnumerable Process(IEnumerable split)
9 | {
10 | if (split.Contains("Rebel"))
11 | return null;
12 |
13 | return split;
14 | }
15 |
16 | protected override string Keyword => "EOS";
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform.Ps/PsPlatformGeneratorBase.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace Net.Chdk.Meta.Generators.Platform.Ps
5 | {
6 | abstract class PsPlatformGeneratorBase : InnerPlatformGenerator
7 | {
8 | private const int MinModelId = 0x1540000;
9 |
10 | protected override IEnumerable PreGenerate(uint modelId, string source)
11 | {
12 | if (modelId < MinModelId)
13 | return null;
14 |
15 | var split = source.Split(' ');
16 | if (!split.Contains(Keyword))
17 | return null;
18 |
19 | return split.Skip(1);
20 | }
21 |
22 | protected override string PostProcess(IEnumerable split)
23 | {
24 | return string.Join(string.Empty, split)
25 | .ToLower();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform.Ps/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Generators.Platform.Ps
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddPsPlatformGenerator(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton()
11 | .AddSingleton()
12 | .AddSingleton()
13 | .AddSingleton();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Generators.Platform/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Generators.Platform
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddPlatformGenerator(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Base/PlatformData.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Net.Chdk.Meta.Model
4 | {
5 | public abstract class PlatformData
6 | where TPlatform : PlatformData
7 | where TRevision : RevisionData
8 | where TSource : SourceData
9 | {
10 | public IDictionary Revisions { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Base/RevisionData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model
2 | {
3 | public abstract class RevisionData
4 | where TRevision : RevisionData
5 | where TSource : SourceData
6 | {
7 | public TSource Source { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Base/SourceData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model
2 | {
3 | public abstract class SourceData
4 | where TSource : SourceData
5 | {
6 | public string Revision { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera.Eos/EosCameraData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera.Eos
2 | {
3 | public sealed class EosCameraData : CameraData
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera.Eos/EosCardData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera.Eos
2 | {
3 | public sealed class EosCardData : CardData
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera.Ps/AltData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera.Ps
2 | {
3 | public sealed class AltData
4 | {
5 | public string Button { get; set; }
6 | public string[] Buttons { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera.Ps/EncodingData.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Json;
2 | using Newtonsoft.Json;
3 |
4 | namespace Net.Chdk.Meta.Model.Camera.Ps
5 | {
6 | public sealed class EncodingData
7 | {
8 | public static readonly EncodingData Empty = new EncodingData
9 | {
10 | Name = string.Empty
11 | };
12 |
13 | public string Name { get; set; }
14 |
15 | [JsonConverter(typeof(HexStringJsonConverter), "x8")]
16 | public uint? Data { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera.Ps/PsCameraData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera.Ps
2 | {
3 | public sealed class PsCameraData : CameraData
4 | {
5 | public EncodingData Encoding { get; set; }
6 | public AltData Alt { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera.Ps/PsCardData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera.Ps
2 | {
3 | public sealed class PsCardData : CardData
4 | {
5 | public bool Multi { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera/BootData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera
2 | {
3 | public sealed class BootData
4 | {
5 | public string Fs { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera/CameraData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera
2 | {
3 | public abstract class CameraData
4 | {
5 | public CameraModelData[] Models { get; set; }
6 | public BootData Boot { get; set; }
7 | }
8 |
9 | public abstract class CameraData : CameraData
10 | where TCamera : CameraData
11 | where TCard : CardData
12 | {
13 | public TCard Card { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera/CameraModelData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera
2 | {
3 | public sealed class CameraModelData
4 | {
5 | public string[] Names { get; set; }
6 | public string Platform { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Camera/CardData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Camera
2 | {
3 | public abstract class CardData
4 | {
5 | public string Type { get; set; }
6 | public string Subtype { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.CameraList/ListPlatformData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.CameraList
2 | {
3 | public sealed class ListPlatformData : PlatformData
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.CameraList/ListRevisionData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.CameraList
2 | {
3 | public sealed class ListRevisionData : RevisionData
4 | {
5 | public string Status { get; set; }
6 | public bool Skip { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.CameraList/ListSourceData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.CameraList
2 | {
3 | public sealed class ListSourceData : SourceData
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.CameraTree/TreePlatformData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.CameraTree
2 | {
3 | public sealed class TreePlatformData : PlatformData
4 | {
5 | public ushort? Id { get; set; }
6 | public byte? Encoding { get; set; }
7 | public bool MultiCard { get; set; }
8 | public string[] AltNames { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.CameraTree/TreeRevisionData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.CameraTree
2 | {
3 | public sealed class TreeRevisionData : RevisionData
4 | {
5 | public ushort? Id { get; set; }
6 | public byte? Encoding { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.CameraTree/TreeSourceData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.CameraTree
2 | {
3 | public sealed class TreeSourceData : SourceData
4 | {
5 | public string Platform { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Model.Platform/PlatformData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Model.Platform
2 | {
3 | public sealed class PlatformData
4 | {
5 | public string ModelId { get; set; }
6 | public string[] Names { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Base/SingleCategoryProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace Net.Chdk.Meta.Providers
6 | {
7 | public abstract class SingleCategoryProvider
8 | where TInnerProvider : ICategoryNameProvider
9 | {
10 | private Dictionary InnerProviders { get; }
11 |
12 | protected SingleCategoryProvider(IEnumerable innerProviders)
13 | {
14 | InnerProviders = innerProviders.ToDictionary(
15 | p => p.CategoryName,
16 | p => p);
17 | }
18 |
19 | protected TInnerProvider GetInnerProvider(string categoryName)
20 | {
21 | if (!InnerProviders.TryGetValue(categoryName, out TInnerProvider value))
22 | throw new InvalidOperationException($"Unknown category: {categoryName}");
23 | return value;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Base/SingleExtensionProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Linq;
4 |
5 | namespace Net.Chdk.Meta.Providers
6 | {
7 | public abstract class SingleExtensionProvider
8 | where TInnerProvider : IExtensionProvider
9 | {
10 | private Dictionary InnerProviders { get; }
11 |
12 | protected SingleExtensionProvider(IEnumerable innerProviders)
13 | {
14 | InnerProviders = innerProviders.ToDictionary(
15 | p => p.Extension,
16 | p => p);
17 | }
18 |
19 | protected TInnerProvider GetInnerProvider(string path, out string ext)
20 | {
21 | ext = Path.GetExtension(path);
22 | InnerProviders.TryGetValue(ext, out TInnerProvider value);
23 | return value;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Base/SingleProductProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace Net.Chdk.Meta.Providers
6 | {
7 | public abstract class SingleProductProvider
8 | where TInnerProvider : IProductNameProvider
9 | {
10 | private Dictionary InnerProviders { get; }
11 |
12 | protected SingleProductProvider(IEnumerable innerProviders)
13 | {
14 | InnerProviders = innerProviders.ToDictionary(
15 | p => p.ProductName,
16 | p => p);
17 | }
18 |
19 | protected TInnerProvider GetInnerProvider(string productName)
20 | {
21 | if (!InnerProviders.TryGetValue(productName, out TInnerProvider value))
22 | throw new InvalidOperationException($"Unknown product: {productName}");
23 | return value;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Base/ProductCameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera
4 | {
5 | public abstract class ProductCameraBootProvider : IProductCameraBootProvider
6 | {
7 | public BootData GetBoot(uint modelId, bool multi)
8 | {
9 | return new BootData
10 | {
11 | Fs = GetBootFileSystem(modelId, multi),
12 | };
13 | }
14 |
15 | public abstract string ProductName { get; }
16 |
17 | protected abstract string GetBootFileSystem(uint modelId, bool multi);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Base/ProductCameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera
4 | {
5 | public abstract class ProductCameraCardProvider : IProductCameraCardProvider
6 | where TCard : CardData, new()
7 | {
8 | public virtual TCard GetCard(uint modelId, bool multi)
9 | {
10 | return new TCard
11 | {
12 | Type = GetCardType(modelId),
13 | Subtype = GetCardSubtype(modelId),
14 | };
15 | }
16 |
17 | public abstract string ProductName { get; }
18 |
19 | protected abstract string GetCardType(uint modelId);
20 | protected abstract string GetCardSubtype(uint modelId);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Chdk/ChdkCameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Providers.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Chdk
4 | {
5 | sealed class ChdkCameraBootProvider : PsCameraBootProvider
6 | {
7 | public override string ProductName => "CHDK";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Chdk/ChdkCameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Providers.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Chdk
4 | {
5 | sealed class ChdkCameraCardProvider : PsCameraCardProvider
6 | {
7 | public override string ProductName => "CHDK";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Chdk/ChdkCameraModelValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Chdk
4 | {
5 | sealed class ChdkCameraModelValidator : ProductCameraModelValidator
6 | {
7 | public ChdkCameraModelValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | protected override void OnTreeRevisionMissing(string platform, string revision)
13 | {
14 | Logger.LogWarning("{0}: {1} missing from tree", platform, revision);
15 | }
16 |
17 | public override string ProductName => "CHDK";
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Chdk/ChdkCameraPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.Camera.Chdk
2 | {
3 | sealed class ChdkCameraPlatformProvider : ProductCameraPlatformProvider
4 | {
5 | public override string ProductName => "CHDK";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Chdk/ChdkCameraValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Chdk
4 | {
5 | sealed class ChdkCameraValidator : ProductCameraValidator
6 | {
7 | public ChdkCameraValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | protected override void OnListPlatformMissing(string platform)
13 | {
14 | Logger.LogWarning("{0} missing from list", platform);
15 | }
16 |
17 | public override string ProductName => "CHDK";
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/IBuildProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Model.CameraList;
3 | using Net.Chdk.Meta.Model.CameraTree;
4 | using Net.Chdk.Meta.Model.Platform;
5 | using System.Collections.Generic;
6 |
7 | namespace Net.Chdk.Meta.Providers.Camera
8 | {
9 | public interface IBuildProvider
10 | {
11 | IDictionary GetCameras(IDictionary platforms, IDictionary list, IDictionary tree,
12 | string productName);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera
4 | {
5 | public interface ICameraBootProvider
6 | {
7 | BootData GetBoot(uint modelId, bool multi, string productName);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera
4 | {
5 | public interface ICameraCardProvider
6 | where TCard : CardData
7 | {
8 | TCard GetCard(uint modelId, bool multi, string productName);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICameraModelProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Model.CameraList;
3 | using Net.Chdk.Meta.Model.CameraTree;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | public interface ICameraModelProvider
8 | {
9 | CameraModelData GetModel(string platform, string[] names, ListPlatformData list, TreePlatformData tree, string productName);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICameraModelValidator.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Model.CameraTree;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera
5 | {
6 | public interface ICameraModelValidator
7 | {
8 | void Validate(string platform, ListPlatformData list, TreePlatformData tree, string productName);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICameraPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 | using Net.Chdk.Meta.Model.Platform;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | public interface ICameraPlatformProvider
8 | {
9 | PlatformData GetPlatform(string key, IDictionary platform, string productName);
10 | TreePlatformData GetTree(string key, IDictionary tree, string productName);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICameraProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Model.CameraList;
3 | using Net.Chdk.Meta.Model.CameraTree;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | public interface ICameraProvider
8 | where TCamera : CameraData
9 | where TCard : CardData
10 | {
11 | TCamera GetCamera(uint modelId, string platform, ListPlatformData list, TreePlatformData tree, string productName);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICameraValidator.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Model.CameraTree;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | public interface ICameraValidator
8 | {
9 | void Validate(IDictionary list, IDictionary tree, string productName);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/ICategoryBuildProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Model.CameraList;
3 | using Net.Chdk.Meta.Model.CameraTree;
4 | using Net.Chdk.Meta.Model.Platform;
5 | using System.Collections.Generic;
6 |
7 | namespace Net.Chdk.Meta.Providers.Camera
8 | {
9 | public interface ICategoryBuildProvider : ICategoryNameProvider
10 | {
11 | IDictionary GetCameras(IDictionary platforms, IDictionary list, IDictionary tree,
12 | string productName);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/IProductCameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera
4 | {
5 | public interface IProductCameraBootProvider : IProductNameProvider
6 | {
7 | BootData GetBoot(uint modelId, bool multi);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/IProductCameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera
4 | {
5 | public interface IProductCameraCardProvider : IProductNameProvider
6 | where TCard : CardData
7 | {
8 | TCard GetCard(uint modelId, bool multi);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/IProductCameraModelValidator.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Model.CameraTree;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera
5 | {
6 | public interface IProductCameraModelValidator : IProductNameProvider
7 | {
8 | void Validate(string platform, ListPlatformData list, TreePlatformData tree);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/IProductCameraPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 | using Net.Chdk.Meta.Model.Platform;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | public interface IProductCameraPlatformProvider : IProductNameProvider
8 | {
9 | PlatformData GetPlatform(string key, IDictionary platform);
10 | TreePlatformData GetTree(string key, IDictionary tree);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Core/IProductCameraValidator.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Model.CameraTree;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | public interface IProductCameraValidator : IProductNameProvider
8 | {
9 | void Validate(IDictionary list, IDictionary tree);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Eos.Base/EosCameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Eos;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Eos
4 | {
5 | public abstract class EosCameraCardProvider : ProductCameraCardProvider
6 | {
7 | protected override string GetCardSubtype(uint modelId)
8 | {
9 | return null;
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Eos/EosBuildProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Eos;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Eos
4 | {
5 | sealed class EosBuildProvider : CategoryBuildProvider
6 | {
7 | public EosBuildProvider(ICameraProvider cameraProvider, ICameraModelProvider modelProvider,
8 | ICameraPlatformProvider platformProvider, ICameraValidator cameraValidator)
9 | : base(cameraProvider, modelProvider, platformProvider, cameraValidator)
10 | {
11 | }
12 |
13 | public override string CategoryName => "EOS";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Eos/EosCameraProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Eos;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Eos
4 | {
5 | sealed class EosCameraProvider : CameraProvider, ICameraProvider
6 | {
7 | public EosCameraProvider(ICameraBootProvider bootProvider, ICameraCardProvider cardProvider)
8 | : base(bootProvider, cardProvider)
9 | {
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Eos/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Net.Chdk.Meta.Model.Camera.Eos;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera.Eos
5 | {
6 | public static class ServiceCollectionExtensions
7 | {
8 | public static IServiceCollection AddEosBuildProvider(this IServiceCollection serviceCollection)
9 | {
10 | return serviceCollection
11 | .AddSingleton()
12 | .AddSingleton, EosCameraProvider>();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Fhp/FhpCameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.Camera.Fhp
2 | {
3 | sealed class FhpCameraBootProvider : ProductCameraBootProvider
4 | {
5 | public override string ProductName => "400plus";
6 |
7 | protected override string GetBootFileSystem(uint modelId, bool multi) => "FAT32";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Fhp/FhpCameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Providers.Camera.Eos;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Fhp
4 | {
5 | sealed class FhpCameraCardProvider : EosCameraCardProvider
6 | {
7 | public override string ProductName => "400plus";
8 |
9 | protected override string GetCardType(uint modelId) => "CF";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Fhp/FhpCameraModelValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Fhp
4 | {
5 | sealed class FhpCameraModelValidator : ProductCameraModelValidator
6 | {
7 | public FhpCameraModelValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | public override string ProductName => "400plus";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Fhp/FhpCameraPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.Camera.Fhp
2 | {
3 | sealed class FhpCameraPlatformProvider : ProductCameraPlatformProvider
4 | {
5 | public override string ProductName => "400plus";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Fhp/FhpCameraValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Fhp
4 | {
5 | sealed class FhpCameraValidator : ProductCameraValidator
6 | {
7 | public FhpCameraValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | public override string ProductName => "400plus";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Fhp/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Net.Chdk.Meta.Model.Camera.Eos;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera.Fhp
5 | {
6 | public static class ServiceCollectionExtensions
7 | {
8 | public static IServiceCollection AddFhpCameraProviders(this IServiceCollection serviceCollection)
9 | {
10 | return serviceCollection
11 | .AddSingleton()
12 | .AddSingleton()
13 | .AddSingleton, FhpCameraCardProvider>()
14 | .AddSingleton()
15 | .AddSingleton();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ml/MlCameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.Camera.Ml
2 | {
3 | sealed class MlCameraBootProvider : ProductCameraBootProvider
4 | {
5 | public override string ProductName => "ML";
6 |
7 | protected override string GetBootFileSystem(uint modelId, bool multi) => "exFAT";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ml/MlCameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Providers.Camera.Eos;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Ml
4 | {
5 | sealed class MlCameraCardProvider : EosCameraCardProvider
6 | {
7 | public override string ProductName => "ML";
8 |
9 | protected override string GetCardType(uint modelId) => "SD";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ml/MlCameraModelValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Ml
4 | {
5 | sealed class MlCameraModelValidator : ProductCameraModelValidator
6 | {
7 | public MlCameraModelValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | public override string ProductName => "ML";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ml/MlCameraPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.Camera.Ml
2 | {
3 | sealed class MlCameraPlatformProvider : ProductCameraPlatformProvider
4 | {
5 | public override string ProductName => "ML";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ml/MlCameraValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Ml
4 | {
5 | sealed class MlCameraValidator : ProductCameraValidator
6 | {
7 | public MlCameraValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | public override string ProductName => "ML";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ml/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Net.Chdk.Meta.Model.Camera.Eos;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera.Ml
5 | {
6 | public static class ServiceCollectionExtensions
7 | {
8 | public static IServiceCollection AddMlCameraProviders(this IServiceCollection serviceCollection)
9 | {
10 | return serviceCollection
11 | .AddSingleton()
12 | .AddSingleton()
13 | .AddSingleton, MlCameraCardProvider>()
14 | .AddSingleton()
15 | .AddSingleton();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ps.Base/PsCameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.Camera.Ps
2 | {
3 | public abstract class PsCameraBootProvider : ProductCameraBootProvider
4 | {
5 | private const uint MinModelId = 0x1010000;
6 | private const uint MinFat32ModelId = 0x2980000;
7 |
8 | protected override string GetBootFileSystem(uint modelId, bool multi)
9 | {
10 | return modelId < MinModelId || modelId >= MinFat32ModelId
11 | ? (!multi ? "FAT32" : "exFAT")
12 | : "FAT";
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ps.Core/IAltProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Ps
4 | {
5 | public interface IAltProvider
6 | {
7 | AltData GetAlt(string platform, string[] altNames, string productName);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ps.Core/IEncodingProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Ps
4 | {
5 | public interface IEncodingProvider
6 | {
7 | EncodingData GetEncoding(string platform, uint version);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ps.Core/IProductAltProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Ps
4 | {
5 | public interface IProductAltProvider : IProductNameProvider
6 | {
7 | AltData GetAlt(string platform, string[] altNames);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ps/AltProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Ps;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera.Ps
5 | {
6 | sealed class AltProvider : SingleProductProvider, IAltProvider
7 | {
8 | public AltProvider(IEnumerable innerProviders)
9 | : base(innerProviders)
10 | {
11 | }
12 |
13 | public AltData GetAlt(string platform, string[] altNames, string productName)
14 | {
15 | return GetInnerProvider(productName).GetAlt(platform, altNames);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ps/PsBuildProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Ps
4 | {
5 | sealed class PsBuildProvider : CategoryBuildProvider
6 | {
7 | public PsBuildProvider(ICameraProvider cameraProvider, ICameraModelProvider modelProvider,
8 | ICameraPlatformProvider platformProvider, ICameraValidator cameraValidator)
9 | : base(cameraProvider, modelProvider, platformProvider, cameraValidator)
10 | {
11 | }
12 |
13 | public override string CategoryName => "PS";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Ps/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using Net.Chdk.Meta.Model.Camera.Ps;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera.Ps
5 | {
6 | public static class ServiceCollectionExtensions
7 | {
8 | public static IServiceCollection AddPsBuildProvider(this IServiceCollection serviceCollection)
9 | {
10 | return serviceCollection
11 | .AddSingleton()
12 | .AddSingleton, PsCameraProvider>()
13 | .AddSingleton()
14 | .AddSingleton();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Sdm/SdmAltProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using Net.Chdk.Meta.Providers.Camera.Ps;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera.Sdm
5 | {
6 | sealed class SdmAltProvider : ProductAltProvider
7 | {
8 | public SdmAltProvider(ILogger logger)
9 | : base(logger)
10 | {
11 | }
12 |
13 | public override string ProductName => "SDM";
14 |
15 | protected override string GetAltButton(string platform, string[] altNames)
16 | {
17 | return "Menu";
18 | }
19 |
20 | protected override string[] GetAltButtons(string platform, string[] altNames)
21 | {
22 | return null;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Sdm/SdmCameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Providers.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Sdm
4 | {
5 | sealed class SdmCameraBootProvider : PsCameraBootProvider
6 | {
7 | public override string ProductName => "SDM";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Sdm/SdmCameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Providers.Camera.Ps;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Sdm
4 | {
5 | sealed class SdmCameraCardProvider : PsCameraCardProvider
6 | {
7 | public override string ProductName => "SDM";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Sdm/SdmCameraModelValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Sdm
4 | {
5 | sealed class SdmCameraModelValidator : ProductCameraModelValidator
6 | {
7 | public SdmCameraModelValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | public override string ProductName => "SDM";
13 |
14 | protected override void OnListRevisionMissing(string platform, string revision)
15 | {
16 | Logger.LogWarning("{0}: {1} missing from list", platform, revision);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera.Sdm/SdmCameraValidator.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera.Sdm
4 | {
5 | sealed class SdmCameraValidator : ProductCameraValidator
6 | {
7 | public SdmCameraValidator(ILogger logger)
8 | : base(logger)
9 | {
10 | }
11 |
12 | public override string ProductName => "SDM";
13 |
14 | protected override void OnListPlatformMissing(string platform)
15 | {
16 | Logger.LogWarning("{0} missing from list", platform);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera/CameraBootProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera
5 | {
6 | sealed class CameraBootProvider : SingleProductProvider, ICameraBootProvider
7 | {
8 | public CameraBootProvider(IEnumerable innerProviders)
9 | : base(innerProviders)
10 | {
11 | }
12 |
13 | public BootData GetBoot(uint modelId, bool multi, string productName)
14 | {
15 | return GetInnerProvider(productName).GetBoot(modelId, multi);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera/CameraCardProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.Camera
5 | {
6 | sealed class CameraCardProvider : SingleProductProvider>, ICameraCardProvider
7 | where TCard : CardData
8 | {
9 | public CameraCardProvider(IEnumerable> innerProviders)
10 | : base(innerProviders)
11 | {
12 | }
13 |
14 | public TCard GetCard(uint modelId, bool multi, string productName)
15 | {
16 | return GetInnerProvider(productName).GetCard(modelId, multi);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera/CameraModelProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Model.CameraList;
3 | using Net.Chdk.Meta.Model.CameraTree;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | sealed class CameraModelProvider : ICameraModelProvider
8 | {
9 | private ICameraModelValidator ModelValidator { get; }
10 |
11 | public CameraModelProvider(ICameraModelValidator modelValidator)
12 | {
13 | ModelValidator = modelValidator;
14 | }
15 |
16 | public CameraModelData GetModel(string platform, string[] names, ListPlatformData list, TreePlatformData tree, string productName)
17 | {
18 | ModelValidator.Validate(platform, list, tree, productName);
19 | return new CameraModelData
20 | {
21 | Platform = platform,
22 | Names = names,
23 | };
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera/CameraModelValidator.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Model.CameraTree;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | sealed class CameraModelValidator : SingleProductProvider, ICameraModelValidator
8 | {
9 | public CameraModelValidator(IEnumerable innerValidators)
10 | : base(innerValidators)
11 | {
12 | }
13 |
14 | public void Validate(string platform, ListPlatformData list, TreePlatformData tree, string productName)
15 | {
16 | GetInnerProvider(productName).Validate(platform, list, tree);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera/CameraValidator.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Model.CameraTree;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.Camera
6 | {
7 | sealed class CameraValidator : SingleProductProvider, ICameraValidator
8 | {
9 | public CameraValidator(IEnumerable innerValidators)
10 | : base(innerValidators)
11 | {
12 | }
13 |
14 | public void Validate(IDictionary list, IDictionary tree, string productName)
15 | {
16 | GetInnerProvider(productName).Validate(list, tree);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Camera/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.Camera
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddBuildProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton()
11 | .AddSingleton()
12 | .AddSingleton()
13 | .AddSingleton()
14 | .AddSingleton()
15 | .AddSingleton()
16 | .AddSingleton(typeof(ICameraCardProvider<>), typeof(CameraCardProvider<>));
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList.Core/ICameraListProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.CameraList
5 | {
6 | public interface ICameraListProvider
7 | {
8 | IDictionary GetCameraList(string path, string productName);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList.Core/IInnerCameraListProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.CameraList
5 | {
6 | public interface IInnerCameraListProvider : IExtensionProvider
7 | {
8 | IDictionary GetCameraList(string path, string productName);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList.Csv/CsvCameraListProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Providers.Csv;
3 | using System;
4 | using System.Collections.Generic;
5 |
6 | namespace Net.Chdk.Meta.Providers.CameraList.Csv
7 | {
8 | sealed class CsvCameraListProvider : CsvCameraProvider, IInnerCameraListProvider
9 | {
10 | public IDictionary GetCameraList(string path, string productName)
11 | {
12 | return GetCameras(path);
13 | }
14 |
15 | protected override ListRevisionData GetRevisionData(string[] split)
16 | {
17 | var revision = base.GetRevisionData(split);
18 | revision.Skip = "SKIP_AUTOBUILD".Equals(split[4], StringComparison.Ordinal);
19 | revision.Status = split[2].ToLowerInvariant();
20 | return revision;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList.Csv/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraList.Csv
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCsvCameraListProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList.Json/JsonCameraListProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using Net.Chdk.Meta.Providers.Json;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.CameraList.Json
6 | {
7 | sealed class JsonCameraListProvider : JsonCameraProvider, IInnerCameraListProvider
8 | {
9 | #region IInnerCameraListProvider Members
10 |
11 | public IDictionary GetCameraList(string path, string productName)
12 | {
13 | return GetCameras(path);
14 | }
15 |
16 | #endregion
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList.Json/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraList.Json
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddJsonCameraListProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList.Zip/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraList.Zip
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddZipCameraListProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList/CameraListProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraList;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.CameraList
6 | {
7 | sealed class CameraListProvider : SingleExtensionProvider, ICameraListProvider
8 | {
9 | public CameraListProvider(IEnumerable innerProviders)
10 | : base(innerProviders)
11 | {
12 | }
13 |
14 | public IDictionary GetCameraList(string path, string productName)
15 | {
16 | var provider = GetInnerProvider(path, out string ext);
17 | if (provider == null)
18 | throw new InvalidOperationException($"Unknown camera list extension: {ext}");
19 | return provider.GetCameraList(path, productName);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraList/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraList
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCameraListProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Core/ICameraTreeProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.CameraTree
5 | {
6 | public interface ICameraTreeProvider
7 | {
8 | IDictionary GetCameraTree(string path);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Core/IInnerCameraTreeProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.CameraTree
5 | {
6 | public interface IInnerCameraTreeProvider : IExtensionProvider
7 | {
8 | IDictionary GetCameraTree(string path);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Csv/CsvCameraTreeProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 | using Net.Chdk.Meta.Providers.Csv;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.CameraTree.Csv
6 | {
7 | sealed class CsvCameraTreeProvider : CsvCameraProvider, IInnerCameraTreeProvider
8 | {
9 | public IDictionary GetCameraTree(string path)
10 | {
11 | return GetCameras(path);
12 | }
13 |
14 | protected override TreeSourceData GetSourceData(string[] split)
15 | {
16 | var source = base.GetSourceData(split);
17 | source.Platform = split[0];
18 | return source;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Csv/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraTree.Csv
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCsvCameraTreeProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Json/JsonCameraTreeProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 | using Net.Chdk.Meta.Providers.Json;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.CameraTree.Json
6 | {
7 | sealed class JsonCameraTreeProvider : JsonCameraProvider, IInnerCameraTreeProvider
8 | {
9 | #region IInnerCameraTreeProvider Members
10 |
11 | public IDictionary GetCameraTree(string path)
12 | {
13 | return GetCameras(path);
14 | }
15 |
16 | #endregion
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Json/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraTree.Json
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddJsonCameraTreeProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Src/CameraData.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraTree.Src
4 | {
5 | sealed class CameraData
6 | {
7 | public string[] AltNames { get; set; }
8 | public bool MultiCard { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Src/MakefileParsingProvider.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraTree.Src
4 | {
5 | abstract class MakefileParsingProvider : ParsingProvider
6 | where T : class
7 | {
8 | protected MakefileParsingProvider(ILogger logger)
9 | : base(logger)
10 | {
11 | }
12 |
13 | protected sealed override string FileName => "makefile.inc";
14 |
15 | protected sealed override string TrimComments(string line, string platform, string revision)
16 | {
17 | var index = line.IndexOf('#');
18 | if (index >= 0)
19 | line = line.Substring(0, index).TrimEnd();
20 | return line;
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Src/RevisionData.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.CameraTree.Src
2 | {
3 | sealed class RevisionData
4 | {
5 | public ushort? Id { get; set; }
6 | public byte? Encoding { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree.Src/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraTree.Src
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddSrcCameraTreeProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton()
11 | .AddSingleton()
12 | .AddSingleton()
13 | .AddSingleton()
14 | .AddSingleton()
15 | .AddSingleton();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree/CameraTreeProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.CameraTree;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Providers.CameraTree
6 | {
7 | sealed class CameraTreeProvider : SingleExtensionProvider, ICameraTreeProvider
8 | {
9 | public CameraTreeProvider(IEnumerable innerProviders)
10 | : base(innerProviders)
11 | {
12 | }
13 |
14 | public IDictionary GetCameraTree(string path)
15 | {
16 | var provider = GetInnerProvider(path, out string ext);
17 | if (provider == null)
18 | throw new InvalidOperationException($"Unknown camera tree extension: {ext}");
19 | return provider.GetCameraTree(path);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.CameraTree/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.CameraTree
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCameraTreeProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Core/CameraInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers
2 | {
3 | public sealed class CameraInfo
4 | {
5 | public string Platform { get; set; }
6 | public string Revision { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Core/ICameraMetaProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers
2 | {
3 | public interface ICameraMetaProvider
4 | {
5 | CameraInfo GetCamera(string productName, string fileName);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Core/ICategoryNameProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers
2 | {
3 | public interface ICategoryNameProvider
4 | {
5 | string CategoryName { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Core/IExtensionProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers
2 | {
3 | public interface IExtensionProvider
4 | {
5 | string Extension { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Core/IProductCameraMetaProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers
2 | {
3 | public interface IProductCameraMetaProvider : IProductNameProvider
4 | {
5 | CameraInfo GetCamera(string fileName);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Core/IProductNameProvider.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers
2 | {
3 | public interface IProductNameProvider
4 | {
5 | string ProductName { get; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Base/InnerPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using System.Linq;
4 |
5 | namespace Net.Chdk.Meta.Providers.Platform
6 | {
7 | public abstract class InnerPlatformProvider : IInnerPlatformProvider
8 | {
9 | private static readonly KeyValuePair[] AddedPlatforms =
10 | {
11 | new KeyValuePair
12 | (
13 | "0x3380000",
14 | "PowerShot N Facebook"
15 | )
16 | };
17 |
18 | IEnumerable> IInnerPlatformProvider.GetPlatforms(TextReader reader)
19 | {
20 | return GetPlatforms(reader)
21 | .Concat(AddedPlatforms);
22 | }
23 |
24 | protected abstract IEnumerable> GetPlatforms(TextReader reader);
25 |
26 | public abstract string Extension { get; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Core/IInnerPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 |
4 | namespace Net.Chdk.Meta.Providers.Platform
5 | {
6 | public interface IInnerPlatformProvider : IExtensionProvider
7 | {
8 | IEnumerable> GetPlatforms(TextReader reader);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Core/IPlatformProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Platform;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.Platform
5 | {
6 | public interface IPlatformProvider
7 | {
8 | IDictionary GetPlatforms(string path);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Html/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.Platform.Html
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddHtmlPlatformProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Xml/Model/Key.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.Serialization;
2 |
3 | namespace Net.Chdk.Meta.Providers.Platform.Xml.Model
4 | {
5 | [XmlType("key")]
6 | public sealed class Key
7 | {
8 | [XmlAttribute("id")]
9 | public string Id { get; set; }
10 |
11 | [XmlElement("val")]
12 | public string Value { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Xml/Model/Table.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.Serialization;
2 |
3 | namespace Net.Chdk.Meta.Providers.Platform.Xml.Model
4 | {
5 | public sealed class Table
6 | {
7 | [XmlAttribute("name")]
8 | public string Name { get; set; }
9 |
10 | [XmlElement("tag")]
11 | public Tag[] Tags { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Xml/Model/Tag.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.Serialization;
2 |
3 | namespace Net.Chdk.Meta.Providers.Platform.Xml.Model
4 | {
5 | public sealed class Tag
6 | {
7 | [XmlAttribute("name")]
8 | public string Name { get; set; }
9 |
10 | [XmlArray("values")]
11 | public Key[] Values { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Xml/Model/TagInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Xml.Serialization;
2 |
3 | namespace Net.Chdk.Meta.Providers.Platform.Xml.Model
4 | {
5 | [XmlType("taginfo")]
6 | public sealed class TagInfo
7 | {
8 | [XmlElement("table")]
9 | public Table[] Tables { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform.Xml/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.Platform.Xml
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddXmlPlatformProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform/CameraModel.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Meta.Providers.Platform
2 | {
3 | sealed class CameraModel
4 | {
5 | public string[] Names { get; set; }
6 | public string Platform { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Platform/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.Platform
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddPlatformProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Sdm/SdmCameraMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace Net.Chdk.Meta.Providers.Sdm
4 | {
5 | sealed class SdmCameraMetaProvider : IProductCameraMetaProvider
6 | {
7 | public CameraInfo GetCamera(string name)
8 | {
9 | var split = Path.GetFileNameWithoutExtension(name).Split('-');
10 | return new CameraInfo
11 | {
12 | Platform = split[2],
13 | Revision = split[3]
14 | };
15 | }
16 |
17 | public string ProductName => "SDM";
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Sdm/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.Sdm
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddSdmCameraMetaProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Core/IBuildMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Meta.Providers.Software
4 | {
5 | public interface IBuildMetaProvider
6 | {
7 | SoftwareBuildInfo GetBuild(SoftwareInfo software);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Core/ICategoryMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Category;
2 | using Net.Chdk.Model.Software;
3 |
4 | namespace Net.Chdk.Meta.Providers.Software
5 | {
6 | public interface ICategoryMetaProvider
7 | {
8 | CategoryInfo GetCategory(SoftwareInfo software);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Core/ICompilerMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Meta.Providers.Software
4 | {
5 | public interface ICompilerMetaProvider
6 | {
7 | SoftwareCompilerInfo GetCompiler(SoftwareInfo software);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Core/IEncodingMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Meta.Providers.Software
4 | {
5 | public interface IEncodingMetaProvider
6 | {
7 | SoftwareEncodingInfo GetEncoding(SoftwareInfo software);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Core/IProductMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 |
4 | namespace Net.Chdk.Meta.Providers.Software
5 | {
6 | public interface IProductMetaProvider
7 | {
8 | SoftwareProductInfo GetProduct(string name, DateTime created);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Core/ISoftwareMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Providers.Software
5 | {
6 | public interface ISoftwareMetaProvider
7 | {
8 | IEnumerable GetSoftware(string path, string productName);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Core/ISourceMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Meta.Providers.Software
4 | {
5 | public interface ISourceMetaProvider
6 | {
7 | SoftwareSourceInfo GetSource(SoftwareInfo software);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Sdm/SdmProductMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 | using System;
3 | using System.Globalization;
4 | using System.IO;
5 |
6 | namespace Net.Chdk.Meta.Providers.Software.Sdm
7 | {
8 | sealed class SdmProductMetaProvider : IProductMetaProvider
9 | {
10 | private static readonly CultureInfo Language = new CultureInfo("en");
11 |
12 | public SoftwareProductInfo GetProduct(string name, DateTime created)
13 | {
14 | var split = Path.GetFileNameWithoutExtension(name).Split('-');
15 | return new SoftwareProductInfo
16 | {
17 | Name = split[0],
18 | Version = Version.Parse(split[4]),
19 | Language = Language,
20 | Created = created
21 | };
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Sdm/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.Software.Sdm
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddSdmProductMetaProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software.Zip/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers.Software.Zip
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddZipSoftwareMetaProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers.Software/SourceMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using Net.Chdk.Model.Software;
3 | using Net.Chdk.Providers.Software;
4 |
5 | namespace Net.Chdk.Meta.Providers.Software
6 | {
7 | sealed class SourceMetaProvider : ISourceMetaProvider
8 | {
9 | private ISourceProvider SourceProvider { get; }
10 |
11 | public SourceMetaProvider(ISourceProvider sourceProvider)
12 | {
13 | SourceProvider = sourceProvider;
14 | }
15 |
16 | public SoftwareSourceInfo GetSource(SoftwareInfo software)
17 | {
18 | return SourceProvider.GetSources(software.Product).Single().Source;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers/CameraMetaProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Net.Chdk.Meta.Providers
4 | {
5 | sealed class CameraMetaProvider : SingleProductProvider, ICameraMetaProvider
6 | {
7 | public CameraMetaProvider(IEnumerable innerProviders)
8 | : base(innerProviders)
9 | {
10 | }
11 |
12 | public CameraInfo GetCamera(string productName, string fileName)
13 | {
14 | return GetInnerProvider(productName).GetCamera(fileName);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Providers/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Providers
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCameraMetaProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Camera.Core/ICameraWriter.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Meta.Writers.Camera
5 | {
6 | public interface ICameraWriter
7 | {
8 | void WriteCameras(string path, IDictionary cameras);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Camera.Core/IInnerCameraWriter.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Providers;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Writers.Camera
6 | {
7 | public interface IInnerCameraWriter : IExtensionProvider
8 | {
9 | void WriteCameras(string path, IDictionary cameras);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Camera.Json/JsonCameraWriter.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Writers.Json;
3 | using System.Collections.Generic;
4 |
5 | namespace Net.Chdk.Meta.Writers.Camera
6 | {
7 | sealed class JsonCameraWriter : JsonMetaWriter, IInnerCameraWriter
8 | {
9 | public void WriteCameras(string path, IDictionary cameras)
10 | {
11 | WriteJson(path, cameras);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Camera.Json/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Writers.Camera.Json
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddJsonCameraWriter(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Camera.Props/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Writers.Camera.Props
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddPropsCameraWriter(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Camera/CameraWriter.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Meta.Model.Camera;
2 | using Net.Chdk.Meta.Providers;
3 | using System;
4 | using System.Collections.Generic;
5 |
6 | namespace Net.Chdk.Meta.Writers.Camera
7 | {
8 | sealed class CameraWriter : SingleExtensionProvider, ICameraWriter
9 | {
10 | public CameraWriter(IEnumerable innerWriters)
11 | : base(innerWriters)
12 | {
13 | }
14 |
15 | public void WriteCameras(string path, IDictionary cameras)
16 | {
17 | var writer = GetInnerProvider(path, out string ext);
18 | if (writer == null)
19 | throw new InvalidOperationException($"Unknown camera writer extension: {ext}");
20 | writer.WriteCameras(path, cameras);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Camera/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Writers.Camera
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCameraWriter(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Software.Core/ISoftwareWriter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Net.Chdk.Model.Software;
3 |
4 | namespace Net.Chdk.Meta.Writers.Software
5 | {
6 | public interface ISoftwareWriter
7 | {
8 | void WriteSoftware(string path, IDictionary hash2sw);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Meta.Writers.Software.Json/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Meta.Writers.Software.Json
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddJsonSoftwareWriter(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Camera/BaseInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Model.Camera
2 | {
3 | public sealed class BaseInfo
4 | {
5 | public string Make { get; set; }
6 | public string Model { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Camera/CameraInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Model.Camera
2 | {
3 | public sealed class CameraInfo
4 | {
5 | public BaseInfo Base { get; set; }
6 | public CanonInfo Canon { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Camera/CanonInfo.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Json;
2 | using Newtonsoft.Json;
3 | using System;
4 |
5 | namespace Net.Chdk.Model.Camera
6 | {
7 | public sealed class CanonInfo
8 | {
9 | [JsonConverter(typeof(HexStringJsonConverter))]
10 | public uint ModelId { get; set; }
11 |
12 | [JsonConverter(typeof(HexStringJsonConverter))]
13 | public uint FirmwareRevision { get; set; }
14 |
15 | public Version FirmwareVersion { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.CameraModel/CameraModelInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Model.CameraModel
2 | {
3 | public sealed class CameraModelInfo
4 | {
5 | public string[] Names { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Card/CardInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Model.Card
2 | {
3 | public sealed class CardInfo
4 | {
5 | public string DeviceId { get; set; }
6 | public string DriveLetter { get; set; }
7 | public string Label { get; set; }
8 | public string FileSystem { get; set; }
9 | public ulong? Capacity { get; set; }
10 | public ulong? FreeSpace { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Card/CardInfoExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Net.Chdk.Model.Card
4 | {
5 | public static class CardInfoExtensions
6 | {
7 | public static string GetRootPath(this CardInfo cardInfo)
8 | {
9 | if (cardInfo == null)
10 | throw new ArgumentNullException(nameof(cardInfo));
11 | if (string.IsNullOrEmpty(cardInfo.DriveLetter))
12 | throw new ArgumentException("Invalid drive letter", nameof(cardInfo));
13 | return $"{cardInfo.DriveLetter}\\";
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/ModuleInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Net.Chdk.Model.Software
4 | {
5 | public sealed class ModuleInfo
6 | {
7 | public DateTime? Created { get; set; }
8 | public string Changeset { get; set; }
9 | public SoftwareHashInfo Hash { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/ModulesInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Model.Software
5 | {
6 | public sealed class ModulesInfo
7 | {
8 | public Version Version { get; set; }
9 | public ModulesProductInfo Product { get; set; }
10 | public IDictionary Modules { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/ModulesProductInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Model.Software
2 | {
3 | public sealed class ModulesProductInfo
4 | {
5 | public string Name { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/SoftwareBuildInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Model.Software
2 | {
3 | public sealed class SoftwareBuildInfo
4 | {
5 | public string Name { get; set; }
6 | public string Status { get; set; }
7 | public string Changeset { get; set; }
8 | public string Creator { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/SoftwareCompilerInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Net.Chdk.Model.Software
4 | {
5 | public sealed class SoftwareCompilerInfo
6 | {
7 | public string Name { get; set; }
8 | public string Platform { get; set; }
9 | public Version Version { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/SoftwareEncodingInfo.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Json;
2 | using Newtonsoft.Json;
3 |
4 | namespace Net.Chdk.Model.Software
5 | {
6 | public sealed class SoftwareEncodingInfo
7 | {
8 | public static readonly SoftwareEncodingInfo Empty = new SoftwareEncodingInfo
9 | {
10 | Name = string.Empty
11 | };
12 |
13 | public string Name { get; set; }
14 |
15 | [JsonConverter(typeof(HexStringJsonConverter), "x8")]
16 | public uint? Data { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/SoftwareHashInfo.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System.Collections.Generic;
3 |
4 | namespace Net.Chdk.Model.Software
5 | {
6 | [JsonObject(IsReference = false)]
7 | public sealed class SoftwareHashInfo
8 | {
9 | public string Name { get; set; }
10 |
11 | public IDictionary Values { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/SoftwareInfo.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Category;
2 | using Newtonsoft.Json;
3 | using System;
4 |
5 | namespace Net.Chdk.Model.Software
6 | {
7 | [JsonObject(IsReference = false)]
8 | public sealed class SoftwareInfo
9 | {
10 | public Version Version { get; set; }
11 | public CategoryInfo Category { get; set; }
12 | public SoftwareProductInfo Product { get; set; }
13 | public SoftwareCameraInfo Camera { get; set; }
14 | public SoftwareBuildInfo Build { get; set; }
15 | public SoftwareCompilerInfo Compiler { get; set; }
16 | public SoftwareSourceInfo Source { get; set; }
17 | public SoftwareEncodingInfo Encoding { get; set; }
18 | public SoftwareHashInfo Hash { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/SoftwareProductInfo.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using System;
3 | using System.Globalization;
4 |
5 | namespace Net.Chdk.Model.Software
6 | {
7 | [JsonObject(IsReference = false)]
8 | public sealed class SoftwareProductInfo
9 | {
10 | public string Name { get; set; }
11 | public Version Version { get; set; }
12 | public string VersionPrefix { get; set; }
13 | public string VersionSuffix { get; set; }
14 | public DateTime? Created { get; set; }
15 | public CultureInfo Language { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Model.Software/SoftwareSourceInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Model.Software
2 | {
3 | public sealed class SoftwareSourceInfo
4 | {
5 | public string Name { get; set; }
6 | public string Channel { get; set; }
7 | public System.Uri Url { get; set; }
8 |
9 | public override bool Equals(object obj)
10 | {
11 | var source2 = obj as SoftwareSourceInfo;
12 | if (source2 == null)
13 | return false;
14 | return Name.Equals(source2.Name) && Channel.Equals(source2.Channel) && Url.Equals(source2.Url);
15 | }
16 |
17 | public override int GetHashCode()
18 | {
19 | return Name.GetHashCode() ^ Channel.GetHashCode() ^ Url.GetHashCode();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Boot.Core/IBootProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Net.Chdk.Providers.Boot
4 | {
5 | public interface IBootProvider
6 | {
7 | string GetFileName(string categoryName);
8 | int[][] GetOffsets(string categoryName);
9 | byte[] GetPrefix(string categoryName);
10 | uint GetBlockSize(string categoryName, string fileSystem);
11 | IDictionary GetBytes(string categoryName, string fileSystem);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Boot.Core/IScriptProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Net.Chdk.Providers.Boot
4 | {
5 | public interface IScriptProvider
6 | {
7 | uint GetBlockSize(string fileSystem);
8 | IDictionary GetBytes(string fileSystem);
9 | IDictionary GetFiles();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Boot/IInnerBootProvider.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Net.Chdk.Providers.Boot
4 | {
5 | interface IInnerBootProvider
6 | {
7 | string FileName { get; }
8 | int[][] Offsets { get; }
9 | byte[] Prefix { get; }
10 |
11 | uint GetBlockSize(string fileSystem);
12 | IDictionary GetBytes(string fileSystem);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Boot/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Providers.Boot
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddBootProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 |
13 | public static IServiceCollection AddScriptProvider(this IServiceCollection serviceCollection)
14 | {
15 | return serviceCollection
16 | .AddSingleton();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Camera.Core/AltInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Net.Chdk.Providers.Camera
2 | {
3 | public sealed class AltInfo
4 | {
5 | public static readonly AltInfo Empty = new AltInfo();
6 |
7 | public string Button { get; set; }
8 | public string[] Buttons { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Camera.Core/CameraModelsInfo.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 | using Net.Chdk.Model.CameraModel;
3 |
4 | namespace Net.Chdk.Providers.Camera
5 | {
6 | public sealed class CameraModelsInfo
7 | {
8 | public CameraInfo Info { get; set; }
9 | public CameraModelInfo[] Models { get; set; }
10 | public string CardType { get; set; }
11 | public string CardSubtype { get; set; }
12 | public string BootFileSystem { get; set; }
13 | public bool IsMultiPartition { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Camera.Core/ICameraProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 | using Net.Chdk.Model.CameraModel;
3 | using Net.Chdk.Model.Software;
4 |
5 | namespace Net.Chdk.Providers.Camera
6 | {
7 | public interface ICameraProvider
8 | {
9 | CameraModelsInfo GetCameraModels(CameraInfo cameraInfo);
10 | CameraModelsInfo GetCameraModels(SoftwareProductInfo productInfo, SoftwareCameraInfo cameraInfo);
11 | SoftwareCameraInfo GetCamera(string productName, CameraInfo cameraInfo, CameraModelInfo cameraModelInfo);
12 | SoftwareEncodingInfo GetEncoding(SoftwareProductInfo productInfo, SoftwareCameraInfo cameraInfo);
13 | AltInfo GetAlt(SoftwareProductInfo productInfo, SoftwareCameraInfo cameraInfo);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Camera/IProductCameraProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Camera;
2 | using Net.Chdk.Model.CameraModel;
3 | using Net.Chdk.Model.Software;
4 |
5 | namespace Net.Chdk.Providers.Camera
6 | {
7 | interface IProductCameraProvider
8 | {
9 | CameraModelsInfo GetCameraModels(CameraInfo cameraInfo);
10 | CameraModelsInfo GetCameraModels(SoftwareCameraInfo cameraInfo);
11 | SoftwareCameraInfo GetCamera(CameraInfo cameraInfo, CameraModelInfo cameraModelInfo);
12 | SoftwareEncodingInfo GetEncoding(SoftwareCameraInfo cameraInfo);
13 | AltInfo GetAlt(SoftwareCameraInfo cameraInfo);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Camera/ReverseCameraData.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Software;
2 |
3 | namespace Net.Chdk.Providers.Camera
4 | {
5 | sealed class ReverseCameraData
6 | {
7 | public string[] Models { get; set; }
8 | public uint ModelId { get; set; }
9 | public SoftwareEncodingInfo Encoding { get; set; }
10 | public AltInfo Alt { get; set; }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Camera/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 |
3 | namespace Net.Chdk.Providers.Camera
4 | {
5 | public static class ServiceCollectionExtensions
6 | {
7 | public static IServiceCollection AddCameraProvider(this IServiceCollection serviceCollection)
8 | {
9 | return serviceCollection
10 | .AddSingleton();
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Category.Core/ICategoryProvider.cs:
--------------------------------------------------------------------------------
1 | using Net.Chdk.Model.Category;
2 |
3 | namespace Net.Chdk.Providers.Category
4 | {
5 | public interface ICategoryProvider
6 | {
7 | string[] GetCategoryNames();
8 | CategoryInfo[] GetCategories();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Net.Chdk.Providers.Category/ServiceCollectionExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.DependencyInjection;
2 | using System;
3 |
4 | namespace Net.Chdk.Providers.Category
5 | {
6 | public static class ServiceCollectionExtensions
7 | {
8 | public static IServiceCollection AddCategoryProvider(this IServiceCollection serviceCollection)
9 | {
10 | return serviceCollection
11 | .AddSingleton