/// <summary>
 /// Initializes this configuration control to default values.
 /// </summary>
 /// <param name="environment">Information about the plugin environment.</param>
 public void Initialize(PluginEnvironment environment)
 {
     _data = new MyQScanActivityData();
     assetSelectionControl1.Initialize(AssetAttributes.None);
     lockTimeoutControl.Initialize(_data.LockTimeouts);
     SetConfiguration();
 }
 /// <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)
 {
     _data = configuration.GetMetadata <MyQScanActivityData>();
     _pluginConfigurationData = configuration;
     assetSelectionControl1.Initialize(_pluginConfigurationData.Assets, AssetAttributes.None);
     lockTimeoutControl.Initialize(_data.LockTimeouts);
     SetConfiguration();
 }
Ejemplo n.º 3
0
 public MyQScanScanManager(PluginExecutionData pluginExecutionData, ScanOptions scanOptions) : base(pluginExecutionData)
 {
     _pluginExecutionData = pluginExecutionData;
     _activityData        = _pluginExecutionData.GetMetadata <MyQScanActivityData>();
     if (ScanLog != null)
     {
         ScanLog.Ocr = false;
     }
     ScanOptions = scanOptions;
 }
Ejemplo n.º 4
0
        /// <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)
        {
            MyQScanActivityData data = executionData.GetMetadata <MyQScanActivityData>();

            UpdateStatus("Starting MyQ Scan activity.");

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

            MyQScanScanManager manager = new MyQScanScanManager(executionData, scanOptions);

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

            PluginExecutionResult executionResult = manager.RunScanActivity();

            UpdateStatus("Finished activity.");
            UpdateStatus($"Result = {executionResult.Result}");

            return(executionResult);
        }