9

I'd like to distinguish between a scheduled unpublish action and an immediate unpublish action via the Event System. Is this possible?

2 Answers 2

11

In the UnPublishEventArgs there is a member UnPublishInstruction. This will have a property - StartAt - If StartAt property is set to DateTime.MinValue that means the Unpublishing is scheduled for Immediate unpublish and if it is set to a particular datetime, that means it is schedule to unpublish at some other time.

1
  • Realized after submit that a similar answer has already been submitted :P Commented Oct 11, 2013 at 8:44
6

Of course. UnPublishEventArgs has property UnPublishInstruction which in turn has StartAt. So if StartAt is set - it's scheduled action

1
  • 4
    One small correction - the StartAt will always be set to some value - If it is set to DateTime.MinValue then the unpublishing is immediate and if it set to any other particular datetime, then it is schedule for some later time :) Commented Oct 11, 2013 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.