ConfigurationSection.GetRuntimeObject Method ()
Returns a custom object when overridden in a derived class.
Assembly: System.Configuration (in System.Configuration.dll)
When the GetSection method is called at run time, the configuration system first creates an appropriate instance of the ConfigurationSection class, and then returns the object it obtains from the method.
By default, ConfigurationSection from which it is called.simply returns the object that represents the
Notes to Implementers:
You can override themethod to return a custom type at run time.
For example, to restrict runtime modification of the settings in the ConfigurationSection class, you can override and return a custom type that enforces restrictions on which settings can be modified, if any.
If the runtime object is internal only, the returned object cannot be used outside the assembly that defines it. One way to create an object that derives from ConfigurationSection and can only be accessed by code in your assembly at run time is to create an internal runtime object that has a method that returns your ConfigurationSection implementation.
The following example shows how to use themethod.
' Customizes the use of CustomSection ' by setting _ReadOnly to false. ' Remember you must use it along with ThrowIfReadOnly. Protected Overrides Function GetRuntimeObject() As Object ' To enable property setting just assign true to ' the following flag. _ReadOnly = True Return MyBase.GetRuntimeObject() End Function 'GetRuntimeObject
Available since 2.0