Beispiel #1
0
        private void ConfigureControls(RegusKioskActivityData data)
        {
            authtype_ComboBox.Text = data.AuthType.GetDescription();

            if (data.AuthType.Equals(RegusKioskAuthType.Login))
            {
                id_TextBox.Text  = data.ID;
                pwd_TextBox.Text = data.Password;
            }
            else if (data.AuthType.Equals(RegusKioskAuthType.Pin))
            {
                pin_TextBox.Text = data.Pin;
            }

            switch (data.JobType)
            {
            case RegusKioskJobType.Copy:
                jobBuildPageCount_numericUpDown.Value = data.CopyOptions.JobBuildPageCount;
                break;

            case RegusKioskJobType.Print:
                path_textBox.Text         = data.PrintOptions.Path;
                printSource_comboBox.Text = data.PrintOptions.PrintSource.GetDescription();
                break;

            case RegusKioskJobType.Scan:
                scanDestination_comboBox.Text         = data.ScanOptions.ScanDestination.GetDescription();
                jobBuildPageCount_numericUpDown.Value = data.ScanOptions.JobBuildPageCount;
                break;
            }

            lockTimeoutControl.Initialize(data.LockTimeouts);
        }
        /// <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)
        {
            _data = executionData.GetMetadata <RegusKioskActivityData>();

            if (_data.JobType.Equals(RegusKioskJobType.Copy))
            {
                return(ExecuteCopy(executionData));
            }
            else if (_data.JobType.Equals(RegusKioskJobType.Print))
            {
                return(ExecutePrint(executionData));
            }
            else if (_data.JobType.Equals(RegusKioskJobType.Scan))
            {
                return(ExecuteScan(executionData));
            }
            return(new PluginExecutionResult(PluginResult.Failed, $"Unrecognized Connector Job Type: {_data.JobType}", ConnectorExceptionCategory.FalseAlarm.GetDescription()));
        }
Beispiel #3
0
        /// <summary>
        /// Creates and returns a <see cref="PluginConfigurationData" /> instance containing the
        /// configuration data from this control.
        /// </summary>
        /// <returns>The configuration data.</returns>
        public PluginConfigurationData GetConfiguration()
        {
            RegusKioskActivityData _activityData = new RegusKioskActivityData()
            {
                AuthType = EnumUtil.GetByDescription <RegusKioskAuthType>(authtype_ComboBox.SelectedItem.ToString()),
                ID       = id_TextBox.Text,
                Password = pwd_TextBox.Text,
                Pin      = pin_TextBox.Text,

                CopyOptions  = _coptions,
                PrintOptions = _poptions,
                ScanOptions  = _soptions,
                LockTimeouts = lockTimeoutControl.Value
            };

            if (copy_RadioButton.Checked)
            {
                _activityData.JobType = RegusKioskJobType.Copy;
                _activityData.CopyOptions.JobBuildPageCount = (int)jobBuildPageCount_numericUpDown.Value;
            }
            else if (print_RadioButton.Checked)
            {
                _activityData.JobType = RegusKioskJobType.Print;
                _activityData.PrintOptions.PrintSource = EnumUtil.GetByDescription <RegusKioskPrintSource>(printSource_comboBox.Text);
                _activityData.PrintOptions.Path        = path_textBox.Text;
            }
            else if (scan_RadioButton.Checked)
            {
                _activityData.JobType = RegusKioskJobType.Scan;
                _activityData.ScanOptions.ScanDestination   = EnumUtil.GetByDescription <RegusKioskScanDestination>(scanDestination_comboBox.Text);
                _activityData.ScanOptions.JobBuildPageCount = (int)jobBuildPageCount_numericUpDown.Value;
            }

            return(new PluginConfigurationData(_activityData, "1.0")
            {
                Assets = assetSelectionControl.AssetSelectionData,
            });
        }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RegusKioskPrintManager" /> class.
 /// </summary>
 /// <param name="executionData">The execution data.</param>
 /// <param name="printOptions">The scan options.</param>
 public RegusKioskPrintManager(PluginExecutionData executionData, RegusKioskPrintOptions printOptions, LockTimeoutData lockTimeoutData)
     : base(executionData, lockTimeoutData)
 {
     _data = executionData.GetMetadata <RegusKioskActivityData>();
     _regusKioskPrintOptions = _data.PrintOptions;
 }