コード例 #1
0
        /// <summary>
        /// Defines and executes the LocalPullPrintExample workflow.
        /// </summary>
        /// <param name="executionData">Information used in the execution of this workflow.</param>
        /// <returns>The result of executing the workflow.</returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            var result = new PluginExecutionResult(PluginResult.Error, "Unknown");

            _data = executionData.GetMetadata <SdkPullPrintExampleActivityData>();

            UpdateStatus("Starting execution");

            // Get a random device from the selected assets and log it
            var device = executionData.Assets.GetRandom() as HP.ScalableTest.Framework.Assets.IDeviceInfo;

            UpdateStatus($"Selecting and connecting to device {device.AssetId} ({device.Address})...");
            IDeviceProxy proxy = DeviceProxyFactory.Create(device.Address, device.AdminPassword);

            // Define the parameters for a device lock token
            var token = new AssetLockToken(device, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));

            // Acquire a lock on the device to prevent other STB activities that require exclusive access
            // Perform the action and capture the result
            ExecutionServices.CriticalSection.Run(token, () =>
            {
                result = PerformPullPrint(executionData, result, device, proxy);
            }
                                                  );

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Initializes the configuration control with the supplied configuration settings.
        /// </summary>
        /// <param name="configuration">Pre-configured plugin settings.</param>
        /// <param name="environment">Domain and plugin specific environment data.</param>
        public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
        {
            // Deserialize the plugin specific configuration settings.
            _data = configuration.GetMetadata <SdkPullPrintExampleActivityData>();

            // Initialize the asset selection control with current selection stored in data
            assetSelectionControl.Initialize(configuration.Assets, HP.ScalableTest.Framework.Assets.AssetAttributes.None);

            // Set the top level button name from the configuration data
            textBoxButtonName.Text = _data.TopLevelButtonName;
        }
コード例 #3
0
 /// <summary>
 /// Initializes the configuration control to default values.
 /// </summary>
 /// <param name="environment">Domain and plugin specific environment data.</param>
 public void Initialize(PluginEnvironment environment)
 {
     _data = new SdkPullPrintExampleActivityData();
 }