Exemple #1
0
        /// <summary>
        /// Updates all the Lists containing the properties for the selected Scanner Source
        /// </summary>
        private void GetSelectedScannerSourceProperties()
        {
            // Get all supported options for the selected scanning source
            ScannerFormats.Clear();
            ScannerFormats = ScannerHelper.GetSupportedImageFormats(SelectedScanner, SelectedScannerSource);
            ScannerColourModes.Clear();
            ScannerColourModes = ScannerHelper.GetSupportedColourModes(SelectedScanner, SelectedScannerSource);
            //ScannerAutoCropppingModes.Clear();
            //ScannerAutoCropppingModes = ScannerHelper.GetSupportedAutoCroppingModes(SelectedScanner, SelectedScannerSource);
            // #TODO Build this for DPI

            // Select Defaults
            switch (SelectedScannerSource)
            {
            case ImageScannerScanSource.Feeder:
            {
                // Format
                var defaultScannerFormat = SelectedScanner.FeederConfiguration.DefaultFormat;
                if (ScannerFormats.Contains(defaultScannerFormat))
                {
                    SelectedScannerFormat = defaultScannerFormat;
                }
                // Colour mode
                var defaultColourMode = SelectedScanner.FeederConfiguration.DefaultColorMode;
                if (ScannerColourModes.Contains(defaultColourMode))
                {
                    SelectedScannerColourMode = defaultColourMode;
                }
                // Auto Cropping Mode
                //SelectedScanner.FeederConfiguration.AutoCroppingMode = ImageScannerAutoCroppingMode.Disabled;

                break;
            }

            case ImageScannerScanSource.Flatbed:
            {
                // Format
                var defaultScannerFormat = SelectedScanner.FlatbedConfiguration.DefaultFormat;
                if (ScannerFormats.Contains(defaultScannerFormat))
                {
                    SelectedScannerFormat = defaultScannerFormat;
                }
                // Colour mode
                var defaultColourMode = SelectedScanner.FlatbedConfiguration.DefaultColorMode;
                if (ScannerColourModes.Contains(defaultColourMode))
                {
                    SelectedScannerColourMode = defaultColourMode;
                }
                // Auto Cropping Mode
                //SelectedScanner.FlatbedConfiguration.AutoCroppingMode = ImageScannerAutoCroppingMode.Disabled;

                break;
            }

            case ImageScannerScanSource.AutoConfigured:
            {
                // Only Format is available as a customisable option here
                var defaultScannerFormat = SelectedScanner.AutoConfiguration.DefaultFormat;
                if (ScannerFormats.Contains(defaultScannerFormat))
                {
                    SelectedScannerFormat = defaultScannerFormat;
                }
                break;
            }

            case ImageScannerScanSource.Default:
            {
                // No available settings for this
                break;
            }
            }


            // #TODO Update Visibility statusses
        }