3 // Permission is hereby granted, free of charge, to any person obtaining
4 // a copy of this software and associated documentation files (the
5 // "Software"), to deal in the Software without restriction, including
6 // without limitation the rights to use, copy, modify, merge, publish,
7 // distribute, sublicense, and/or sell copies of the Software, and to
8 // permit persons to whom the Software is furnished to do so, subject to
9 // the following conditions:
11 // The above copyright notice and this permission notice shall be
12 // included in all copies or substantial portions of the Software.
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 // System.Configuration.DictionarySectionHandler.cs
27 // Christopher Podurgiel (cpodurgiel@msn.com)
29 // (C) Chris Podurgiel
32 using System
.Collections
;
33 using System
.Collections
.Specialized
;
37 using XmlNode
= System
.Object
;
40 namespace System
.Configuration
43 /// Summary description for DictionarySectionHandler.
45 public class DictionarySectionHandler
: IConfigurationSectionHandler
48 /// Creates a new DictionarySectionHandler object and adds the object to the collection.
50 /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
51 /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
52 /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
53 /// <returns></returns>
54 public virtual object Create(object parent
, object context
, XmlNode section
)
57 return ConfigHelper
.GetDictionary (parent
as IDictionary
, section
,
58 KeyAttributeName
, ValueAttributeName
);
65 /// Gets the name of the key attribute tag. This property is overidden by derived classes to change
66 /// the name of the key attribute tag. The default is "key".
68 protected virtual string KeyAttributeName
76 /// Gets the name of the value tag. This property may be overidden by derived classes to change
77 /// the name of the value tag. The default is "value".
79 protected virtual string ValueAttributeName