IsModified Method

ConfigurationElement.IsModified Method ()


Indicates whether this configuration element has been modified since it was last saved or loaded, when implemented in a derived class.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

protected internal virtual bool IsModified()

Return Value

Type: System.Boolean

true if the element has been modified; otherwise, false.

The IsModified method determines whether this ConfigurationElement object will be written to the configuration file when the Save method is called. If the return value is false, it is assumed that the configuration file represents the current state of the element.

By default, IsModified returns true after a property is set through the indexer to this ConfigurationElement object.

Override the IsModified method to provide custom indication of the state of this ConfigurationElement element.

The following example shows how to extend IsModified.

The method shown in the previous example is called when a configuration element is modified, as in the following example.

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft