Exemplo n.º 1
0
        /// <summary>
        /// Validates the given metadata against the ScanToJobStorage Activity data.
        /// </summary>
        /// <param name="configurationData">The configuration data.</param>
        /// <returns>true if valid</returns>
        public bool ValidateMetadata(ref PluginConfigurationData configurationData)
        {
            bool validData = true;
            ScanToJobStorageData activityData = null;

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

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

            return(validData);
        }
Exemplo n.º 2
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)
        {
            ScanToJobStorageData activityData = configuration.GetMetadata <ScanToJobStorageData>(ConverterProvider.GetMetadataConverters());

            ConfigureControls(activityData);
            assetSelectionControl.Initialize(configuration.Assets, DeviceAttributes);
            assetSelectionControl.AdfDocuments = configuration.Documents;
        }
 /// <summary>
 /// Scan Manager for the ScanToJobStorage plugin.
 /// </summary>
 public JobStorageScanManager(PluginExecutionData executionData)
     : base(executionData)
 {
     _data       = executionData.GetMetadata <ScanToJobStorageData>(ConverterProvider.GetMetadataConverters());
     ScanOptions = _data.ScanOptions;
 }
Exemplo n.º 4
0
        /// <summary>
        /// The execute method for Scan To JobStorage plugin.
        /// </summary>
        /// <param name="executionData">
        /// The execution data.
        /// </param>
        /// <returns>
        /// The <see cref="PluginExecutionResult"/>.
        /// </returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            ScanToJobStorageData data = executionData.GetMetadata <ScanToJobStorageData>(ConverterProvider.GetMetadataConverters());

            JobStorageScanManager manager = new JobStorageScanManager(executionData);

            manager.ActivityStatusChanged += UpdateStatus;
            manager.DeviceSelected        += UpdateDevice;
            return(manager.RunScanActivity());
        }