コード例 #1
0
 /// <summary>
 /// Initializes the control based on saved data
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="environment">The environment.</param>
 public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
 {
     _activityData = configuration.GetMetadata <JetAdvantageScanActivityData>();
     assetSelectionControl.AdfDocuments = configuration.Documents;
     LoadSettings();
     SetControlValues();
 }
コード例 #2
0
        /// <summary>
        /// Processes the activity given to the plugin.
        /// </summary>
        /// <param name="executionData"></param>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            PluginExecutionResult result = new PluginExecutionResult(PluginResult.Passed);

            _activityData = _pluginExecutionData.GetMetadata <JetAdvantageScanActivityData>();
            _device       = (IDeviceInfo)executionData.Assets.First();
            UpdateStatus("Starting JetAdvantage " + "Scan to Cloud Repository");
            SetDataLogger(_device);

            if (CheckJetAdvantageAvailability())
            {
                ScanOptions scanOptions = new ScanOptions()
                {
                    LockTimeouts = _activityData.LockTimeouts,
                    PageCount    = _activityData.PageCount,
                    UseAdf       = _activityData.UseAdf,
                };
                _controller = new JetAdvantageScanAutoController(executionData, scanOptions);
                _controller.ActivityStatusChanged += UpdateStatus;
                _controller.DeviceSelected        += UpdateDevice;
                UpdateDataLogger(result);
                return(_controller.RunScanActivity());
            }

            else
            {
                result = new PluginExecutionResult(PluginResult.Failed);
                UpdateDataLogger(result);
                return(result);
            }
        }
コード例 #3
0
        /// <summary>
        /// HP JetAdvantage constructor
        /// </summary>
        public JetAdvantageScanAutoController(PluginExecutionData executionData, ScanOptions scanOptions)
            : base(executionData)
        {
            var device = (IDeviceInfo)executionData.Assets.First();

            _device     = new JediWindjammerDevice(device.Address, device.AdminPassword);
            _data       = executionData.GetMetadata <JetAdvantageScanActivityData>();
            _engine     = new OxpdBrowserEngine(_device.ControlPanel);
            ScanOptions = scanOptions;
        }
コード例 #4
0
 /// <summary>
 /// Initializes the specified environment with empty data.
 /// </summary>
 /// <param name="environment">The environment.</param>
 public void Initialize(PluginEnvironment environment)
 {
     _activityData = new JetAdvantageScanActivityData();
     LoadSettings();
     SetControlValues();
 }