public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
        {
            _data = configuration.GetMetadata <SecurityConfigurationActivityData>();
            security_assetSelectionControl.Initialize(configuration.Assets, Framework.Assets.AssetAttributes.None);

            LoadUi();
        }
        /// <summary>
        /// Execution
        /// </summary>
        /// <param name="executionData"></param>
        /// <returns></returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            if (!_setupDone)
            {
                TelnetLibrary.EnableTelnetFeature();
                _setupDone = true;
            }

            _activityData = executionData.GetMetadata <SecurityConfigurationActivityData>();

            var printer = (PrintDeviceInfo)executionData.Assets.First();

            try
            {
                _strAuthorization = ConvertToBase64Encoding($"admin:{ (object)printer.AdminPassword}");

                switch (_activityData.SecurityType)
                {
                case SecurityConfigurationType.Basic:
                {
                    BasicEnhancedSecurityConfig(printer, SecurityConfigurationType.Basic);
                }
                break;

                case SecurityConfigurationType.Enhanced:
                {
                    BasicEnhancedSecurityConfig(printer, SecurityConfigurationType.Enhanced);
                }
                break;

                case SecurityConfigurationType.Custom:
                {
                    CustomSecurityConfiguration(printer, SecurityConfigurationType.Custom);
                }
                break;
                }
            }
            catch (Exception exception)
            {
                return(new PluginExecutionResult(PluginResult.Failed, $"Failed for {printer.Address}: {exception.Message}"));
            }

            return(new PluginExecutionResult(PluginResult.Passed));
        }
 public void Initialize(PluginEnvironment environment)
 {
     _data = new SecurityConfigurationActivityData();
     LoadUi();
 }