Files
Umbraco-CMS/src/Umbraco.Core/Events/PublishEventArgs.cs
Morten Christensen 5dbcfa57a8 Implements the new publish and unpublish events in the PublishingStrategy.
Making the PublishStrategy public, so that its possible to subscribe to the events.
Removing the old PublishingEventArgs, which is no longer used.
Correcting a few comments.
2012-12-28 14:47:09 -01:00

59 lines
1.9 KiB
C#

using System.Collections.Generic;
namespace Umbraco.Core.Events
{
public class PublishEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
{
/// <summary>
/// Constructor accepting multiple entities that are used in the publish operation
/// </summary>
/// <param name="eventObject"></param>
/// <param name="canCancel"></param>
/// <param name="isAllPublished"></param>
public PublishEventArgs(IEnumerable<TEntity> eventObject, bool canCancel, bool isAllPublished)
: base(eventObject, canCancel)
{
IsAllRepublished = isAllPublished;
}
/// <summary>
/// Constructor accepting multiple entities that are used in the publish operation
/// </summary>
/// <param name="eventObject"></param>
public PublishEventArgs(IEnumerable<TEntity> eventObject)
: base(eventObject)
{
}
/// <summary>
/// Constructor accepting a single entity instance
/// </summary>
/// <param name="eventObject"></param>
public PublishEventArgs(TEntity eventObject)
: base(new List<TEntity> { eventObject })
{
}
/// <summary>
/// Constructor accepting a single entity instance
/// </summary>
/// <param name="eventObject"></param>
/// <param name="canCancel"></param>
/// <param name="isAllPublished"></param>
public PublishEventArgs(TEntity eventObject, bool canCancel, bool isAllPublished)
: base(new List<TEntity> { eventObject }, canCancel)
{
IsAllRepublished = isAllPublished;
}
/// <summary>
/// Returns all entities that were published during the operation
/// </summary>
public IEnumerable<TEntity> PublishedEntities
{
get { return EventObject; }
}
public bool IsAllRepublished { get; private set; }
}
}