Esempio n. 1
0
        virtual public void Clear()
        {
            // Only clear items of this type
            // that match the predicate.

            var items = _RealObject
                        .OfType <TNew>()
                        .ToArray();

            foreach (var item in items)
            {
                _RealObject.Remove(item);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1" />.
        /// </summary>
        public void Clear( )
        {
            // Only clear items of this type
            // that match the predicate.

            TNew[] items = _realObject
                           .OfType <TNew>( )
                           .Where(_predicate)
                           .ToArray( );

            foreach (TNew item in items)
            {
                _realObject.Remove(item);
            }
        }