public static void RemoveAll(this SadConsole.ConsoleCollection _thisCliClec) { foreach (SadConsole.Console cli in _thisCliClec.ToList()) { _thisCliClec.Remove(cli); } }
public static void RemoveAll <T>(this SadConsole.ConsoleCollection _thisCliClec) where T : SadConsole.Console { foreach (SadConsole.Console cli in _thisCliClec.ToList()) { if (cli is T cliAsT) { _thisCliClec.Remove(cliAsT); } } }
public static void RemoveAll <T>(this SadConsole.ConsoleCollection _thisCliClec, out IEnumerable <T> removedElements) where T : SadConsole.Console { var removed = new List <T>(); foreach (SadConsole.Console cli in _thisCliClec.ToList()) { if (cli is T cliAsT) { removed.Add(cliAsT); _thisCliClec.Remove(cli); } } removedElements = removed; }