예제 #1
0
 public static void RemoveAll(this SadConsole.ConsoleCollection _thisCliClec)
 {
     foreach (SadConsole.Console cli in _thisCliClec.ToList())
     {
         _thisCliClec.Remove(cli);
     }
 }
예제 #2
0
 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);
         }
     }
 }
예제 #3
0
        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;
        }