public static IEnumerable <EnvDTE.ProjectItem> DescendantsAndSelf([CanBeNull] this EnvDTE.ProjectItem projectItem) { if (projectItem == null) { yield break; } yield return(projectItem); foreach (var item in projectItem.Descendants()) { yield return(item); } }
public static IEnumerable <EnvDTE.ProjectItem> DescendantsAndSelf(this EnvDTE.ProjectItem projectItem) { Contract.Ensures(Contract.Result <IEnumerable <EnvDTE.ProjectItem> >() != null); if (projectItem == null) { yield break; } yield return(projectItem); foreach (var item in projectItem.Descendants()) { yield return(item); } }