Beispiel #1
0
        //--------------------------------------------------------------
        #region Methods
        //--------------------------------------------------------------

        /// <summary>
        /// Removes all particle parameters in this collection.
        /// </summary>
        public void Clear()
        {
            if (_collection.Count > 0)
            {
                _collection.Clear();
                OnChanged(EventArgs.Empty);
            }
        }
        public void Clear_should_remove_names()
        {
            NamedObjectCollection <ImplicityNamed> t = new NamedObjectCollection <ImplicityNamed>();
            var item = new ImplicityNamed {
                Name = "a"
            };

            t.Add(item);
            t.Clear();

            Assert.Equal(0, t.Count);
            Assert.Null(t["a"]);
        }