Exemplo n.º 1
0
        /// <summary>
        /// Initializes this configuration control with the specified <see cref="PluginConfigurationData" />.
        /// </summary>
        /// <param name="configuration">The configuration data.</param>
        /// <param name="environment">Information about the plugin environment.</param>
        public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
        {
            ConfigureControls(configuration.GetMetadata <ScanToUsbData>(ConverterProvider.GetMetadataConverters()));

            assetSelectionControl.Initialize(configuration.Assets, _deviceAttributes);
            assetSelectionControl.AdfDocuments = configuration.Documents;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Validates the given metadata against the ScanToUsb Activity data.
        /// </summary>
        /// <param name="configurationData">The configuration data.</param>
        /// <returns>true if valid</returns>
        public bool ValidateMetadata(ref PluginConfigurationData configurationData)
        {
            bool          validData    = true;
            ScanToUsbData activityData = null;

            try
            {
                activityData = configurationData.GetMetadata <ScanToUsbData>(ConverterProvider.GetMetadataConverters());
            }
            catch
            {
                activityData = new ScanToUsbData();
                validData    = false;
            }

            configurationData = new PluginConfigurationData(activityData, ScanToUsbConfigControl.Version);

            return(validData);
        }
Exemplo n.º 3
0
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            ScanToUsbData data = executionData.GetMetadata <ScanToUsbData>(ConverterProvider.GetMetadataConverters());

            UsbScanManager manager;

            if (string.IsNullOrWhiteSpace(data.DigitalSendServer))
            {
                manager = new UsbScanManager(executionData);
            }
            else
            {
                manager = new UsbScanManager(executionData, data.DigitalSendServer);
            }

            manager.ActivityStatusChanged += UpdateStatus;
            manager.DeviceSelected        += UpdateDevice;
            return(manager.RunScanActivity());
        }
Exemplo n.º 4
0
 public UsbScanManager(PluginExecutionData executionData, string serverName)
     : base(executionData, serverName)
 {
     _data       = executionData.GetMetadata <ScanToUsbData>(ConverterProvider.GetMetadataConverters());
     ScanOptions = _data.ScanOptions;
 }