ICloseStrategy.cs 851 B

12345678910111213141516171819
  1. namespace Caliburn.Micro.Core {
  2. using System;
  3. using System.Collections.Generic;
  4. /// <summary>
  5. /// Used to gather the results from multiple child elements which may or may not prevent closing.
  6. /// </summary>
  7. /// <typeparam name="T">The type of child element.</typeparam>
  8. public interface ICloseStrategy<T> {
  9. /// <summary>
  10. /// Executes the strategy.
  11. /// </summary>
  12. /// <param name="toClose">Items that are requesting close.</param>
  13. /// <param name="callback">The action to call when all enumeration is complete and the close results are aggregated.
  14. /// The bool indicates whether close can occur. The enumerable indicates which children should close if the parent cannot.</param>
  15. void Execute(IEnumerable<T> toClose, Action<bool, IEnumerable<T>> callback);
  16. }
  17. }