Пример #1
0
 /// <summary>
 /// Returns a collection of <see cref="SPWeb"/> objects that will be disposed by its <see cref="IEnumerator"/>.
 /// </summary>
 /// <param name="webs">The <see cref="SPWebCollection"/> that contains the sites to enumerate.</param>
 /// <returns>An <see cref="IEnumerable{SPWeb}"/> that will dispose each <see cref="SPWeb"/> returned.</returns>
 public static IEnumerable <SPWeb> AsSafeEnumerable(this SPWebCollection webs)
 {
     return(webs.AsSafeEnumerable(null));
 }
Пример #2
0
 public static void ForEach(this SPWebCollection source, Action <SPWeb> action)
 {
     source.AsSafeEnumerable().ForEach(action);
 }
Пример #3
0
 public static IEnumerable <SPWeb> GetWebs(this SPWebCollection source, Func <SPWeb, bool> predicate)
 {
     return(source.AsSafeEnumerable().Where(predicate));
 }