From 6481688d2acc23b789dab6e8ad04a96e48c46064 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 3 May 2013 00:10:11 -0400 Subject: fixes #223 - New Content Localhost Popups Repeat 'Old' 'New Content' on Media Changes --- .../Library/ChildrenChangedEventArgs.cs | 137 --------------------- 1 file changed, 137 deletions(-) delete mode 100644 MediaBrowser.Controller/Library/ChildrenChangedEventArgs.cs (limited to 'MediaBrowser.Controller/Library/ChildrenChangedEventArgs.cs') diff --git a/MediaBrowser.Controller/Library/ChildrenChangedEventArgs.cs b/MediaBrowser.Controller/Library/ChildrenChangedEventArgs.cs deleted file mode 100644 index 94f4c540ff..0000000000 --- a/MediaBrowser.Controller/Library/ChildrenChangedEventArgs.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System.Collections.Concurrent; -using MediaBrowser.Controller.Entities; -using System; -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Library -{ - /// - /// Class ChildrenChangedEventArgs - /// - public class ChildrenChangedEventArgs : EventArgs - { - /// - /// Gets or sets the folder. - /// - /// The folder. - public Folder Folder { get; set; } - /// - /// Gets or sets the items added. - /// - /// The items added. - public ConcurrentBag ItemsAdded { get; set; } - /// - /// Gets or sets the items removed. - /// - /// The items removed. - public List ItemsRemoved { get; set; } - /// - /// Gets or sets the items updated. - /// - /// The items updated. - public ConcurrentBag ItemsUpdated { get; set; } - - /// - /// Create the args and set the folder property - /// - /// The folder. - /// - public ChildrenChangedEventArgs(Folder folder) - { - if (folder == null) - { - throw new ArgumentNullException(); - } - - //init the folder property - Folder = folder; - //init the list - ItemsAdded = new ConcurrentBag(); - ItemsRemoved = new List(); - ItemsUpdated = new ConcurrentBag(); - } - - /// - /// Adds the new item. - /// - /// The item. - /// - public void AddNewItem(BaseItem item) - { - if (item == null) - { - throw new ArgumentNullException(); - } - - ItemsAdded.Add(item); - } - - /// - /// Adds the updated item. - /// - /// The item. - /// - public void AddUpdatedItem(BaseItem item) - { - if (item == null) - { - throw new ArgumentNullException(); - } - - ItemsUpdated.Add(item); - } - - /// - /// Adds the removed item. - /// - /// The item. - /// - public void AddRemovedItem(BaseItem item) - { - if (item == null) - { - throw new ArgumentNullException(); - } - - ItemsRemoved.Add(item); - } - - /// - /// Lists the has change. - /// - /// The list. - /// true if XXXX, false otherwise - private bool ListHasChange(List list) - { - return list != null && list.Count > 0; - } - - /// - /// Lists the has change. - /// - /// The list. - /// true if XXXX, false otherwise - private bool ListHasChange(ConcurrentBag list) - { - return list != null && !list.IsEmpty; - } - - /// - /// Gets a value indicating whether this instance has change. - /// - /// true if this instance has change; otherwise, false. - public bool HasChange - { - get { return HasAddOrRemoveChange || ListHasChange(ItemsUpdated); } - } - - /// - /// Gets a value indicating whether this instance has add or remove change. - /// - /// true if this instance has add or remove change; otherwise, false. - public bool HasAddOrRemoveChange - { - get { return ListHasChange(ItemsAdded) || ListHasChange(ItemsRemoved); } - } - } -} -- cgit v1.2.3