public override void Dispose() { if (items != null) { foreach (SolutionItem e in items) { e.Dispose(); } items = null; } files = null; base.Dispose(); }
protected override void OnDispose() { if (items != null) { foreach (SolutionFolderItem e in items) { e.Dispose(); } items = null; } files = null; base.OnDispose(); }
static SolutionItem FindSolutionItemRecursive(SolutionFolderItemCollection items, string fullPath) { foreach (SolutionFolderItem it in items) { if (it is SolutionFolder sf) { SolutionItem r = FindSolutionItemRecursive(sf.Items, fullPath); if (r != null) { return(r); } } else if (it is SolutionItem se) { if (!string.IsNullOrEmpty(se.FileName) && fullPath == Path.GetFullPath(se.FileName)) { return((SolutionItem)it); } } } return(null); }