/// <summary>
        /// Executes this plug-in'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)
        {
            PluginExecutionResult result = new PluginExecutionResult(PluginResult.Skipped);

            _data       = executionData.GetMetadata <PaperCutInstallerActivityData>();
            _serverInfo = executionData.Servers.FirstOrDefault();

            _printDeviceInfo = executionData.Assets.OfType <PrintDeviceInfo>().FirstOrDefault();
            _device          = DeviceConstructor.Create(_printDeviceInfo);

            var bundleInstaller = new BundleInstaller(_device as JediOmniDevice);

            try
            {
                _signedSessionId = bundleInstaller.SignIn(string.Empty);

                switch (_data.Action)
                {
                case PaperCutInstallerAction.Install:
                {
                    result = bundleInstaller.InstallSolution(_signedSessionId, _data.BundleFile);
                }
                break;

                case PaperCutInstallerAction.Register:
                {
                    result = RegisterDevice();
                }
                break;

                case PaperCutInstallerAction.ConfigureCredentials:
                case PaperCutInstallerAction.ConfigureSettings:
                {
                    result = ConfigureDevice();
                }
                break;
                }
            }
            catch (WebException wex)
            {
                _device.Dispose();
                ExecutionServices.SystemTrace.LogError(
                    $"PaperCut Installer Action {_data.Action} failed on device:{_device.Address}", wex);
                UpdateStatus($"{_printDeviceInfo.AssetId}: Failed with exception: {wex.Message}");
                return(new PluginExecutionResult(PluginResult.Failed, wex.Message));
            }
            catch (Exception ex)
            {
                _device.Dispose();
                ExecutionServices.SystemTrace.LogError(
                    $"PaperCut Installer Action {_data.Action} failed on device:{_device.Address}", ex);
                UpdateStatus($"{_printDeviceInfo.AssetId}: Failed with exception: {ex.Message}");
                return(new PluginExecutionResult(PluginResult.Failed, ex.Message));
            }
            _device.Dispose();
            UpdateStatus($"{_printDeviceInfo.AssetId}: {result.Result}");
            return(result);
        }
        /// <summary>
        /// Initializes the Control for the Existing MetaData
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="environment"></param>
        public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
        {
            _pluginData = configuration.GetMetadata <PaperCutInstallerActivityData>();

            paperCut_assetSelectionControl.Initialize(configuration.Assets, AssetAttributes.ControlPanel);
            paperCut_serverComboBox.Initialize(configuration.Servers.SelectedServers.FirstOrDefault());
            tasks_comboBox.SelectedItem  = _pluginData.Action.ToString();
            bundleFile_textBox.Text      = _pluginData.BundleFile;
            logon_textBox.Text           = _pluginData.AdminUserName;
            password_textBox.Text        = _pluginData.AdminPassword;
            textBox_QueueName.Text       = _pluginData.SourcePrintQueue;
            checkBox_AutoRelease.Checked = _pluginData.AutoRelease;

            if (_pluginData.AuthenticationMethod.HasFlag(PaperCutAuthentication.Password))
            {
                radioButton_password.Checked = true;
            }
            if (_pluginData.AuthenticationMethod.HasFlag(PaperCutAuthentication.Identity))
            {
                radioButton_identity.Checked = true;
            }
            if (_pluginData.AuthenticationMethod.HasFlag(PaperCutAuthentication.SwipeCard))
            {
                checkbox_Card.Checked = true;
            }
            if (_pluginData.AuthenticationMethod.HasFlag(PaperCutAuthentication.Guest))
            {
                checkBox_guest.Checked = true;
            }


            foreach (CheckBox checkBox in tracking_groupBox.Controls)
            {
                int checkBoxAttribute = int.Parse(checkBox.Tag.ToString());
                checkBox.Checked = _pluginData.Tracking.HasFlag((PaperCutTracking)checkBoxAttribute);
            }
        }
 /// <summary>
 /// Initialize the Control for new MetaData
 /// </summary>
 /// <param name="environment"></param>
 public void Initialize(PluginEnvironment environment)
 {
     _pluginData = new PaperCutInstallerActivityData();
     paperCut_assetSelectionControl.Initialize(AssetAttributes.ControlPanel);
     paperCut_serverComboBox.Initialize("PaperCut");
 }