NSoft.NFramework.Nini.Config.ConfigCollection.Remove C# (CSharp) Method

Remove() public method

public Remove ( IConfig config ) : void
config IConfig
return void
        public void Remove(IConfig config) {
            configList.Remove(config);
            OnConfigRemoved(new ConfigEventArgs(config));
        }

Same methods

ConfigCollection::Remove ( object config ) : void

Usage Example

        public void AddAndRemove() {
            ConfigBase config1 = new ConfigBase("Test", null);
            ConfigBase config2 = new ConfigBase("Another", null);
            ConfigCollection collection = new ConfigCollection(null);
            collection.Add(config1);
            collection.Add(config2);

            Assert.AreEqual(2, collection.Count);
            Assert.IsNotNull(collection["Test"]);
            Assert.IsNotNull(collection["Another"]);

            collection.Remove(config2);
            Assert.AreEqual(1, collection.Count);
            Assert.IsNotNull(collection["Test"]);
            Assert.IsNull(collection["Another"]);
        }
All Usage Examples Of NSoft.NFramework.Nini.Config.ConfigCollection::Remove