Beispiel #1
0
        /// <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)
        {
            MyQPullPrintingActivityData data = executionData.GetMetadata <MyQPullPrintingActivityData>();

            UpdateStatus("Starting MyQ Pull Printing activity.");

            if (_documentCollectionIterator == null)
            {
                CollectionSelectorMode mode = data.ShuffleDocuments ? CollectionSelectorMode.ShuffledRoundRobin : CollectionSelectorMode.RoundRobin;
                _documentCollectionIterator = new DocumentCollectionIterator(mode);
            }

            MyQPullPrintManager manager = new MyQPullPrintManager(executionData, data);

            manager.StatusUpdate           += UpdateStatus;
            manager.DeviceSelected         += UpdateDevice;
            manager.DocumentActionSelected += UpdateDocumentAction;
            manager.TimeStatusUpdate       += PullPrintManager_TimeStatusUpdate;
            manager.SessionIdUpdate        += UpdateSessionId;

            if (executionData.PrintQueues.Any() && executionData.Documents.Any())
            {
                try
                {
                    manager.ExecutePrintJob(_documentCollectionIterator, data.UsePrintServerNotification, data.DelayAfterPrint);
                }
                catch (PrintQueueNotAvailableException ex)
                {
                    //This exception has already been logged in the call to manager.ExecutePrintJob
                    return(new PluginExecutionResult(PluginResult.Failed, ex, "Print Failure."));
                }
            }
            return(manager.ExecutePullPrintOperation());
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MyQPullPrintManager"/> class.
 /// </summary>
 /// <param name="pluginExecutionData">The plugin execution data.</param>
 /// <param name="activityData">The activity data.</param>
 public MyQPullPrintManager(PluginExecutionData pluginExecutionData, MyQPullPrintingActivityData activityData) : base(pluginExecutionData)
 {
     _activityData     = activityData;
     PullPrintSolution = "MyQ Print Release";
     this.LockTimeouts = _activityData.LockTimeouts;
     this.AuthProvider = _activityData.AuthProvider;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes this configuration control to default values.
 /// </summary>
 /// <param name="environment">Information about the plugin environment.</param>
 public void Initialize(PluginEnvironment environment)
 {
     _data = new MyQPullPrintingActivityData();
     assetSelectionControl.Initialize(_deviceAttributes);
     printingConfigurationControl.Initialize();
     lockTimeoutControl.Initialize(_data.LockTimeouts);
     SetPullPrintAction();
 }
Beispiel #4
0
        /// <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)
        {
            _data = configuration.GetMetadata <MyQPullPrintingActivityData>();
            _pluginConfigurationData = configuration;

            assetSelectionControl.Initialize(_pluginConfigurationData.Assets, _deviceAttributes);
            printingConfigurationControl.Initialize(_pluginConfigurationData.Documents, _pluginConfigurationData.PrintQueues, _data.DelayAfterPrint, _data.ShuffleDocuments, _data.UsePrintServerNotification);
            lockTimeoutControl.Initialize(_data.LockTimeouts);
            SetConfiguration();
        }