private void ChildAdded(StoreItem childItem) { IStoreItemList childItems = GetChildItems(); if (childItems == null) { return; } // If this child item isn't the type that this parent expects, // don't add it to the list of children. if (!childItems.ItemMatchesListType(childItem)) { Planner.OnInvalidHierarchicalItemEvent(this, childItem); return; } if (!childItems.Contains(childItem)) { childItems.Add(childItem); if (Planner.Instance.IsStartupComplete) { NotifyItemUpdatedWorker(new NotificationArgs(childItem, ChangeType.Added, HierarchicalChangeSource.ChildItem, null)); } if (StoreItem.IsRealItem(ParentItem)) { ParentItem.ChildAdded(this); } } }
private void AddToItemCache() { IStoreItemList itemCache = GetCache(); if (itemCache != null) { itemCache.Add(this); } MaintainFilters(ChangeType.Added); }
private void AddOwnedItem(StoreItem ownedItem) { IStoreItemList ownedItems = GetOwnedItems(); if (ownedItems != null) { if (!ownedItems.Contains(ownedItem)) { ownedItems.Add(ownedItem); if (Planner.Instance.IsStartupComplete) { NotifyItemUpdatedWorker(new NotificationArgs(ownedItem, ChangeType.Added, HierarchicalChangeSource.OwnedItem, null)); } } } }