Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Gets all items that need to be removed for an item (dependencies+item itself)
- /// </summary>
- public IEnumerable<InstallationItemFactory> GetRemovedFor(InstallationItemFactory i)
- {
- return current.ToList().Where(p => p.Dependencies.Contains(i)).SelectMany(GetRemovedFor).Concat(new[] { i }).ToList();
- }
- /// <summary>
- /// Gets a sequence of the item itself and its dependencies
- /// </summary>
- public IEnumerable<InstallationItemFactory> GetAddedFor(InstallationItemFactory i)
- {
- return i.Dependencies.SelectMany(GetAddedFor).Concat(new[] { i }).ToList();
- }
- vs
- public IEnumerable<InstallationItemFactory> GetItemAndDependenciesForAdding(InstallationItemFactory i)
- {
- return i.Dependencies.SelectMany(GetItemAndDependencies).Concat(new[] { i }).ToList();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement