/// <summary> /// Deliver to distribution. /// </summary> private PluginExecutionResult DeliverToDistribution() { PluginExecutionResult result = new PluginExecutionResult(PluginResult.Passed); UpdateStatus("Deliver to Distribution"); _runtimeOriginator = _activityData.SendToDistribution.Originator; _runtimeRecipients = new Collection <string>() { _activityData.SendToDistribution.DistributionTitle }; SetRuntimeData(); PopulateExecutionControls(); foreach (var doc in _runtimeDocumentPaths) { foreach (var recipient in _runtimeRecipients) { // Lock the document pool so that we don't get conflicts with other users. ExecutionServices.CriticalSection.Run(new LocalLockToken("LocalDocument", new TimeSpan(0, 5, 0), new TimeSpan(0, 5, 0)), () => { ProxyClient.DeliverToDistribution(_pluginExecutionData.Servers.First().Address, doc, _runtimeOriginator, recipient); }); } } return(result); }