public AssetList FilterChildren() { AssetList assetList = new AssetList(); assetList.AddRange(this); foreach (Asset asset in this) { assetList.RemoveAll((Asset p) => p.IsChildOf(asset)); } return(assetList); }
// Create an optimised list of assets by removing children of folders in the same list public AssetList FilterChildren() { AssetList unique = new AssetList(); unique.AddRange(this); foreach (Asset asset in this) { unique.RemoveAll(p => p.IsChildOf(asset)); } return(unique); }
public AssetList FilterChildren() { AssetList assetList = new AssetList(); assetList.AddRange(this); using (List <Asset> .Enumerator enumerator = base.GetEnumerator()) { while (enumerator.MoveNext()) { Asset asset = enumerator.Current; assetList.RemoveAll((Asset p) => p.IsChildOf(asset)); } } return(assetList); }
/// <summary> /// <para>Create an optimised list of assets by removing children of folders in the same list.</para> /// </summary> public AssetList FilterChildren() { AssetList assetList = new AssetList(); assetList.AddRange((IEnumerable <Asset>) this); // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type AssetList.\u003CFilterChildren\u003Ec__AnonStoreyC0 childrenCAnonStoreyC0 = new AssetList.\u003CFilterChildren\u003Ec__AnonStoreyC0(); using (List <Asset> .Enumerator enumerator = this.GetEnumerator()) { while (enumerator.MoveNext()) { // ISSUE: reference to a compiler-generated field childrenCAnonStoreyC0.asset = enumerator.Current; // ISSUE: reference to a compiler-generated method assetList.RemoveAll(new Predicate <Asset>(childrenCAnonStoreyC0.\u003C\u003Em__22F)); } } return(assetList); }