/// <summary>
        /// Initializes this configuration control with the specified <see cref="PluginConfigurationData" />.
        /// </summary>
        /// <param name="configuration">The configuration data.</param>
        /// <param name="environment">Information about the plugin environment.</param>
        public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
        {
            var copyData = configuration.GetMetadata <CopyData>(ConverterProvider.GetMetadataConverters());

            ConfigureControls(copyData);
            _options = copyData.Options;
            jobseparator_checkBox.Checked = copyData.PrintJobSeparator;
            LoadPrintQueues(configuration.PrintQueues.SelectedPrintQueues);
            assetSelectionControl.Initialize(configuration.Assets, DeviceAttributes);
            assetSelectionControl.AdfDocuments = configuration.Documents;
            RefreshQueueDataGrid();
        }
        /// <summary>
        /// This is an overridden method, from the Print Support PrintEngine class
        /// PrintTag Virtual Method.
        /// </summary>
        /// <param name="printQueue"></param>
        /// <param name="executionData"></param>
        public override StringBuilder PrintTag(PrintQueue printQueue, PluginExecutionData executionData)
        {
            CopyData data = executionData.GetMetadata <CopyData>(ConverterProvider.GetMetadataConverters());

            PrintCopyData(data);
            _contentToPrint.AppendLine();
            _contentToPrint.AppendLine(string.Format("UserName: {0}", Environment.UserName));
            _contentToPrint.AppendLine(string.Format("Session ID: {0}", executionData.SessionId));
            _contentToPrint.AppendLine(string.Format("Activity ID:{0}", executionData.ActivityExecutionId));
            _contentToPrint.AppendLine(string.Format("Date: {0}", DateTime.Now.ToShortDateString()));
            _contentToPrint.AppendLine(string.Format("Time: {0}", DateTime.Now.ToShortTimeString()));
            return(_contentToPrint);
        }
Beispiel #3
0
        /// <summary>
        /// Validates the given metadata against the Copy Activity data.
        /// </summary>
        /// <param name="configurationData">The configuration data.</param>
        /// <returns>true if valid</returns>
        public bool ValidateMetadata(ref PluginConfigurationData configurationData)
        {
            bool     validData    = true;
            CopyData activityData = null;

            try
            {
                activityData = configurationData.GetMetadata <CopyData>(ConverterProvider.GetMetadataConverters());
            }
            catch
            {
                activityData = new CopyData();
                validData    = false;
            }

            configurationData = new PluginConfigurationData(activityData, CopyConfigControl.Version);

            return(validData);
        }
Beispiel #4
0
        /// <summary>
        /// The execute.
        /// </summary>
        /// <param name="executionData">
        /// The execution data.
        /// </param>
        /// <returns>
        /// The <see cref="PluginExecutionResult"/>.
        /// </returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            CopyData       data        = executionData.GetMetadata <CopyData>(ConverterProvider.GetMetadataConverters());
            PrintQueueInfo item        = executionData.PrintQueues.GetRandom();
            ScanOptions    scanOptions = new ScanOptions()
            {
                LockTimeouts = data.LockTimeouts,
                PageCount    = data.PageCount
            };

            if (data.PrintJobSeparator)
            {
                _engine.PrintJobSeparator(executionData);
            }
            var manager = new CopyManager(executionData, scanOptions);

            manager.ActivityStatusChanged += UpdateStatus;
            manager.DeviceSelected        += UpdateDevice;
            return(manager.RunScanActivity());
        }
Beispiel #5
0
 public CopyManager(PluginExecutionData executionData, ScanOptions scanOptions)
     : base(executionData)
 {
     _data       = executionData.GetMetadata <CopyData>(ConverterProvider.GetMetadataConverters());
     ScanOptions = scanOptions;
 }