System.Configuration.SettingElementCollection.Remove C# (CSharp) Method

Remove() public method

public Remove ( SettingElement element ) : void
element SettingElement
return void
        public void Remove(SettingElement element) {
            BaseRemove(GetElementKey(element));
        }

Usage Example

        public void SuccessfullyRemoveElement()
        {
            var settingElement = new SettingElement("TestElementName", SettingsSerializeAs.String);
            var collection     = new SettingElementCollection();

            collection.Add(settingElement);
            collection.Remove(settingElement);
            var retrievedElement = collection.Get("TestElementName");

            Assert.Null(retrievedElement);
        }