A configuration section for containing an arbitrary serialized object. This implementation allows for redirection to an external configuration file.
More...
|
override object | GetRuntimeObject () |
| Retrieves the contained object from the section. More...
|
|
override void | DeserializeSection (System.Xml.XmlReader reader) |
| Deserializes the configuration section in the configuration file. More...
|
|
override void | DeserializeElement (XmlReader reader, bool serializeCollectionKey) |
| Deserializes the configuration element in the configuration file. More...
|
|
override string | SerializeSection (ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode) |
| Serializes the configuration section to an XML string representation. More...
|
|
override bool | SerializeToXmlElement (XmlWriter writer, string elementName) |
| Serializes the section into the configuration file, possibly writing to the external file as well, if FileName is specified. </summary - Parameters
-
writer | The writer to use for serializing the class.</param - Parameters
-
elementName | The name of the configuration section.</param - Returns
- True if successful, false otherwise.
|
|
|
|
override bool | SerializeElement (XmlWriter writer, bool serializeCollectionKey) |
| Serilize the element to XML. More...
|
|
A configuration section for containing an arbitrary serialized object. This implementation allows for redirection to an external configuration file.
This feature is instrumental in making management of configuration for different environments easy. Keep all configs for all environments and switch between them by switching the file name in the main configuration file.
Adapted from Jon Wojtowicz's solution: http://www.eggheadcafe.com/articles/20060622.asp. Changes include some static helper methods for getting configuration sections, moved strings to resources, some other code cleanup, and a few changes for style.