private PrintActivityData GetPrintData()
        {
            PrintActivityData printData = new PrintActivityData();

            printData.QueueName = queueNameTextBox.Text;
            return(printData);
        }
        /// <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()
        {
            ContentionData data = new ContentionData()
            {
                SelectedControlPanelActivities = GetControlPanelData(),
                SelectedContentionActivities   = GetContentionActivityData()
            };

            LocalPrintQueueInfo     queue = null;
            PrintQueueSelectionData localQueueSelectionData = null;

            if (data.SelectedContentionActivities.OfType <PrintActivityData>().Any())
            {
                PrintActivityData printData = data.SelectedContentionActivities.OfType <PrintActivityData>().Single();
                queue = string.IsNullOrEmpty(printData.QueueName) ? null : new LocalPrintQueueInfo(printData.QueueName);
                localQueueSelectionData = (queue == null) ? null : new PrintQueueSelectionData(queue);
            }

            return(new PluginConfigurationData(data, Version)
            {
                Assets = assetSelectionControl.AssetSelectionData,
                Documents = documentSelectionControl.DocumentSelectionData,
                PrintQueues = localQueueSelectionData
            });
        }
        private void ConfigureControls(ContentionData data)
        {
            //Copy Tab Controls
            if (data.SelectedControlPanelActivities.OfType <CopyActivityData>().Any())
            {
                copy_checkBox.Checked = true;
                CopyActivityData copyData = data.SelectedControlPanelActivities.OfType <CopyActivityData>().Single();
                Copies_NumericUpDown.Value        = copyData.Copies;
                copyPageCount_NumericUpDown.Value = copyData.PageCount;
            }
            else
            {
                copy_checkBox.Checked = false;
            }

            //Scan Tab Controls
            if (data.SelectedControlPanelActivities.OfType <ScanActivityData>().Any())
            {
                scan_checkBox.Checked = true;
                ScanActivityData scanData = data.SelectedControlPanelActivities.OfType <ScanActivityData>().Single();
                switch (scanData.ScanJobType)
                {
                case ContentionScanActivityTypes.Email:
                    emailRadioButton.Checked = true;
                    emailAddressTextBox.Text = scanData.EmailAddress;
                    break;

                case ContentionScanActivityTypes.Folder:
                    folderRadioButton.Checked = true;
                    folderPathTextBox.Text    = scanData.FolderPath;
                    break;

                case ContentionScanActivityTypes.USB:
                    usbRadioButton.Checked = true;
                    usbNameTextBox.Text    = scanData.UsbName;
                    break;

                case ContentionScanActivityTypes.JobStorage:
                    jobStorageRadioButton.Checked = true;
                    break;
                }
                scanPageCount_NumericUpDown.Value = scanData.PageCount;
            }
            else
            {
                scan_checkBox.Checked = false;
            }

            //Fax Tab Controls
            if (data.SelectedControlPanelActivities.OfType <FaxActivityData>().Any())
            {
                faxsend_checkBox.Checked = true;
                FaxActivityData faxData = data.SelectedControlPanelActivities.OfType <FaxActivityData>().Single();
                faxNumber_textBox.Text           = faxData.FaxNumber;
                faxPageCount_NumericUpDown.Value = faxData.PageCount;
            }
            else
            {
                faxsend_checkBox.Checked = false;
            }

            //Print Tab Controls
            if (data.SelectedContentionActivities.OfType <PrintActivityData>().Any())
            {
                print_checkBox.Checked = true;
                PrintActivityData printData = data.SelectedContentionActivities.OfType <PrintActivityData>().Single();
                queueNameTextBox.Text = printData.QueueName;
            }
            else
            {
                print_checkBox.Checked = false;
            }
        }