Пример #1
0
 public HpacScanScanManager(PluginExecutionData pluginExecutionData, ScanOptions scanOptions) : base(pluginExecutionData)
 {
     _pluginExecutionData = pluginExecutionData;
     _activityData        = _pluginExecutionData.GetMetadata <HpacScanActivityData>();
     if (ScanLog != null)
     {
         ScanLog.Ocr = false;
     }
     ScanOptions = scanOptions;
 }
        /// <summary>
        /// Executes this plugin's workflow using the specified <see cref="PluginExecutionData" />.
        /// </summary>
        /// <param name="executionData">The execution data.</param>
        /// <returns>A <see cref="PluginExecutionResult" /> indicating the outcome of the execution.</returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            HpacScanActivityData data = executionData.GetMetadata <HpacScanActivityData>();

            UpdateStatus("Starting activity.");

            ScanOptions scanOptions = new ScanOptions()
            {
                LockTimeouts = data.LockTimeouts,
            };

            HpacScanScanManager manager = new HpacScanScanManager(executionData, scanOptions);

            manager.ActivityStatusChanged += UpdateStatus;
            manager.DeviceSelected        += UpdateDevice;

            PluginExecutionResult result = manager.RunScanActivity();

            UpdateStatus($"Result = {result.Result}");
            return(result);
        }