Add OnLibraryChanged event to server Kernel

pull/702/head
ebr11 Eric Reed spam 12 years ago
parent 922fd3acae
commit 7186d66109

@ -22,7 +22,11 @@ namespace MediaBrowser.Controller.Entities
{
if (ChildrenChanged != null)
{
Task.Run( () => ChildrenChanged(this, args));
Task.Run( () =>
{
ChildrenChanged(this, args);
Kernel.Instance.OnLibraryChanged(args);
});
}
}

@ -25,6 +25,21 @@ namespace MediaBrowser.Controller
{
public class Kernel : BaseKernel<ServerConfiguration, ServerApplicationPaths>
{
#region Events
/// <summary>
/// Fires whenever any validation routine adds or removes items. The added and removed items are properties of the args.
/// *** Will fire asynchronously. ***
/// </summary>
public event EventHandler<ChildrenChangedEventArgs> LibraryChanged;
public void OnLibraryChanged(ChildrenChangedEventArgs args)
{
if (LibraryChanged != null)
{
Task.Run(() => LibraryChanged(this, args));
}
}
#endregion
public static Kernel Instance { get; private set; }
public ItemController ItemController { get; private set; }

Loading…
Cancel
Save