Last active
August 29, 2016 12:23
-
-
Save mskutta/09bad804674c2f6b195b8e98373d2a80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EvaluateResult : PublishItemProcessor | |
{ | |
public override void Process(PublishItemContext context) | |
{ | |
Assert.ArgumentNotNull(context, "context"); | |
// We want to rely on smart publishing so we don't send unnecessary data. Deletes are a weird sceneiro. | |
// If a Republish is performed, we need the delete actions to come through. We cant rely on the Result.Operation for this. | |
if ((context.Action != PublishAction.DeleteTargetItem || context.PublishOptions.CompareRevisions) && | |
(context.Result.Operation == PublishOperation.Skipped || | |
context.Result.Operation == PublishOperation.None)) | |
return; | |
// Note on Deletes... The Operation of delete will only come though once for one of the published languages. | |
// The other languages will have a result of none. | |
// Note on HideVersion = true... The operation of a smart publish will always be PublishOperation.Updated. The causes unnecessary processing. | |
// VersionToPublish is the item being published. | |
// Note: For deletes the VersionToPublish is the parent | |
var item = context.VersionToPublish | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment