/// <summary>
        /// Removes a terminal from the list of managed terminals.
        /// </summary>
        /// <param name="terminal">The terminal to remove.</param>
        /// <returns>A value indicating whether the terminal was found and removed; false if it was not found.</returns>
        public static bool Remove(ITerminal terminal)
        {
            if (!terminals.Any(t => t.Value == terminal))
            {
                return(false);
            }

            terminals.Remove(terminals.Where(t => t.Value == terminal).Single());
            terminal.PowerOff();
            terminal.Dispose();
            return(true);
        }
 public void Dispose()
 {
     _term?.Dispose();
     _completedCommand.Dispose();
 }
示例#3
0
        /// <summary>
        /// Removes a terminal from the list of managed terminals.
        /// </summary>
        /// <param name="terminal">The terminal to remove.</param>
        /// <returns>A value indicating whether the terminal was found and removed; false if it was not found.</returns>
        public static bool Remove(ITerminal terminal)
        {
            if (!terminals.Any(t => t.Value == terminal))
            {
                return false;
            }

            terminals.Remove(terminals.Where(t => t.Value == terminal).Single());
            terminal.PowerOff();
            terminal.Dispose();
            return true;
        }