Changed CollectionSaved event naming to be consistent so is renamed SavedCollection (etc).
Now we have no more IEnumerable<Lazy<T>> collections, we can easily strongly type the event args instead of just IEnumerable, they are now IEnumerable<T>.
This commit is contained in:
@@ -696,7 +696,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional Id of the User saving the Content</param>
|
||||
public void Save(IEnumerable<IContent> contents, int userId = -1)
|
||||
{
|
||||
if (CollectionSaving.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable>(contents), this))
|
||||
if (SavingCollection.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable<IContent>>(contents), this))
|
||||
return;
|
||||
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
@@ -730,7 +730,7 @@ namespace Umbraco.Core.Services
|
||||
//Commit everything in one go
|
||||
uow.Commit();
|
||||
|
||||
CollectionSaved.RaiseEvent(new SaveEventArgs<IEnumerable>(contents, false), this);
|
||||
SavedCollection.RaiseEvent(new SaveEventArgs<IEnumerable<IContent>>(contents, false), this);
|
||||
|
||||
Audit.Add(AuditTypes.Save, "Bulk Save content performed by user", userId == -1 ? 0 : userId, -1);
|
||||
}
|
||||
@@ -1300,12 +1300,12 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Occurs before saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IContentService, SaveEventArgs<IEnumerable>> CollectionSaving;
|
||||
public static event TypedEventHandler<IContentService, SaveEventArgs<IEnumerable<IContent>>> SavingCollection;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs after saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IContentService, SaveEventArgs<IEnumerable>> CollectionSaved;
|
||||
public static event TypedEventHandler<IContentService, SaveEventArgs<IEnumerable<IContent>>> SavedCollection;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs before Create
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional id of the user saving the ContentType</param>
|
||||
public void Save(IEnumerable<IContentType> contentTypes, int userId = -1)
|
||||
{
|
||||
if (CollectionSaving.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable>(contentTypes), this))
|
||||
if (SavingContentTypeCollection.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable<IContentType>>(contentTypes), this))
|
||||
return;
|
||||
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
@@ -154,7 +154,7 @@ namespace Umbraco.Core.Services
|
||||
//save it all in one go
|
||||
uow.Commit();
|
||||
|
||||
CollectionSaved.RaiseEvent(new SaveEventArgs<IEnumerable>(contentTypes, false), this);
|
||||
SavedContentTypeCollection.RaiseEvent(new SaveEventArgs<IEnumerable<IContentType>>(contentTypes, false), this);
|
||||
}
|
||||
|
||||
Audit.Add(AuditTypes.Save, string.Format("Save ContentTypes performed by user"), userId == -1 ? 0 : userId, -1);
|
||||
@@ -317,7 +317,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional Id of the user savging the MediaTypes</param>
|
||||
public void Save(IEnumerable<IMediaType> mediaTypes, int userId = -1)
|
||||
{
|
||||
if (CollectionSaving.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable>(mediaTypes), this))
|
||||
if (SavingMediaTypeCollection.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable<IMediaType>>(mediaTypes), this))
|
||||
return;
|
||||
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
@@ -333,7 +333,7 @@ namespace Umbraco.Core.Services
|
||||
//save it all in one go
|
||||
uow.Commit();
|
||||
|
||||
CollectionSaved.RaiseEvent(new SaveEventArgs<IEnumerable>(mediaTypes, false), this);
|
||||
SavedMediaTypeCollection.RaiseEvent(new SaveEventArgs<IEnumerable<IMediaType>>(mediaTypes, false), this);
|
||||
}
|
||||
|
||||
Audit.Add(AuditTypes.Save, string.Format("Save MediaTypes performed by user"), userId == -1 ? 0 : userId, -1);
|
||||
@@ -538,12 +538,22 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Occurs before saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IContentTypeService, SaveEventArgs<IEnumerable>> CollectionSaving;
|
||||
public static event TypedEventHandler<IContentTypeService, SaveEventArgs<IEnumerable<IContentType>>> SavingContentTypeCollection;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs after saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IContentTypeService, SaveEventArgs<IEnumerable>> CollectionSaved;
|
||||
public static event TypedEventHandler<IContentTypeService, SaveEventArgs<IEnumerable<IContentType>>> SavedContentTypeCollection;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs before saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IContentTypeService, SaveEventArgs<IEnumerable<IMediaType>>> SavingMediaTypeCollection;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs after saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IContentTypeService, SaveEventArgs<IEnumerable<IMediaType>>> SavedMediaTypeCollection;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace Umbraco.Core.Services
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
|
||||
{
|
||||
if (CollectionSaving.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable>(medias), this))
|
||||
if (SavingCollection.IsRaisedEventCancelled(new SaveEventArgs<IEnumerable<IMedia>>(medias), this))
|
||||
return;
|
||||
|
||||
foreach (var media in medias)
|
||||
@@ -377,7 +377,7 @@ namespace Umbraco.Core.Services
|
||||
//commit the whole lot in one go
|
||||
uow.Commit();
|
||||
|
||||
CollectionSaved.RaiseEvent(new SaveEventArgs<IEnumerable>(medias, false), this);
|
||||
SavedCollection.RaiseEvent(new SaveEventArgs<IEnumerable<IMedia>>(medias, false), this);
|
||||
|
||||
Audit.Add(AuditTypes.Save, "Save Media items performed by user", userId == -1 ? 0 : userId, -1);
|
||||
}
|
||||
@@ -447,12 +447,12 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Occurs before saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IMediaService, SaveEventArgs<IEnumerable>> CollectionSaving;
|
||||
public static event TypedEventHandler<IMediaService, SaveEventArgs<IEnumerable<IMedia>>> SavingCollection;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs after saving a collection
|
||||
/// </summary>
|
||||
public static event TypedEventHandler<IMediaService, SaveEventArgs<IEnumerable>> CollectionSaved;
|
||||
public static event TypedEventHandler<IMediaService, SaveEventArgs<IEnumerable<IMedia>>> SavedCollection;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs before Create
|
||||
|
||||
Reference in New Issue
Block a user