Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Sys / System / Configuration / SingleTagSectionHandler.cs / 1 / SingleTagSectionHandler.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Configuration {
using System.Collections;
using System.Xml;
/**
* Single-tag dictionary config factory
*
* Use for tags of the form:
*/
///
///
public class SingleTagSectionHandler : IConfigurationSectionHandler {
/**
* Create
*
* Given a partially composed config object (possibly null)
* and some input from the config system, return a
* further partially composed config object
*/
///
/// [To be supplied.]
///
public virtual object Create(Object parent, Object context, XmlNode section) {
Hashtable result;
// start result off as a shallow clone of the parent
if (parent == null)
result = new Hashtable();
else
result = new Hashtable((IDictionary)parent);
// verify that there are no children
HandlerBase.CheckForChildNodes(section);
// iterate through each XML section in order and apply the directives
foreach (XmlAttribute attribute in section.Attributes) {
// handle name-value pairs
result[attribute.Name] = attribute.Value;
}
return result;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Configuration {
using System.Collections;
using System.Xml;
/**
* Single-tag dictionary config factory
*
* Use for tags of the form:
*/
///
///
public class SingleTagSectionHandler : IConfigurationSectionHandler {
/**
* Create
*
* Given a partially composed config object (possibly null)
* and some input from the config system, return a
* further partially composed config object
*/
///
/// [To be supplied.]
///
public virtual object Create(Object parent, Object context, XmlNode section) {
Hashtable result;
// start result off as a shallow clone of the parent
if (parent == null)
result = new Hashtable();
else
result = new Hashtable((IDictionary)parent);
// verify that there are no children
HandlerBase.CheckForChildNodes(section);
// iterate through each XML section in order and apply the directives
foreach (XmlAttribute attribute in section.Attributes) {
// handle name-value pairs
result[attribute.Name] = attribute.Value;
}
return result;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BinaryFormatter.cs
- ToolboxCategoryItems.cs
- GAC.cs
- Grant.cs
- UseAttributeSetsAction.cs
- SqlDataSourceDesigner.cs
- GenericAuthenticationEventArgs.cs
- PlatformCulture.cs
- PublisherMembershipCondition.cs
- SqlDataSourceStatusEventArgs.cs
- DictionaryKeyPropertyAttribute.cs
- DBDataPermission.cs
- GraphicsPathIterator.cs
- RequestCachePolicy.cs
- WorkflowServiceNamespace.cs
- Decorator.cs
- ACE.cs
- ButtonBase.cs
- LayoutUtils.cs
- StandardCommands.cs
- EnumerableRowCollection.cs
- SqlTriggerContext.cs
- CreateWorkflowOwnerCommand.cs
- LayoutEditorPart.cs
- CryptoStream.cs
- PropertyGeneratedEventArgs.cs
- Selection.cs
- MimeTypeAttribute.cs
- GeneralTransform2DTo3DTo2D.cs
- ColorContextHelper.cs
- ClrPerspective.cs
- ZoneLinkButton.cs
- SecurityVersion.cs
- WebPartConnectionCollection.cs
- DocumentPageHost.cs
- AtlasWeb.Designer.cs
- BmpBitmapDecoder.cs
- CacheAxisQuery.cs
- BinaryParser.cs
- ClosableStream.cs
- UrlMappingsModule.cs
- MSG.cs
- ListViewItem.cs
- EtwTrace.cs
- ProcessStartInfo.cs
- MergeEnumerator.cs
- FrameworkContentElement.cs
- X509UI.cs
- WebDisplayNameAttribute.cs
- AvTraceDetails.cs
- TaskFileService.cs
- HtmlHead.cs
- Encoder.cs
- DesignerAutoFormatStyle.cs
- EventPropertyMap.cs
- BamlRecords.cs
- BasicHttpSecurity.cs
- PrinterSettings.cs
- WarningException.cs
- AttributeEmitter.cs
- RegularExpressionValidator.cs
- WhitespaceRuleLookup.cs
- Menu.cs
- ClientUtils.cs
- SoapCodeExporter.cs
- EnumerableValidator.cs
- NumberFormatInfo.cs
- _ContextAwareResult.cs
- EventsTab.cs
- ResponseStream.cs
- SQLSingle.cs
- ColumnBinding.cs
- GeneralTransform2DTo3D.cs
- ToolboxItemAttribute.cs
- SessionIDManager.cs
- HttpProtocolReflector.cs
- XmlText.cs
- ObfuscationAttribute.cs
- MembershipSection.cs
- TimeStampChecker.cs
- TickBar.cs
- WebBrowsableAttribute.cs
- QueryConverter.cs
- WebPartConnectionsEventArgs.cs
- NativeMethodsOther.cs
- BitmapCache.cs
- SharedDp.cs
- DBCSCodePageEncoding.cs
- WebServiceBindingAttribute.cs
- ArrayList.cs
- WebBrowserHelper.cs
- DataTable.cs
- TypeToArgumentTypeConverter.cs
- RectangleGeometry.cs
- Block.cs
- ArrangedElementCollection.cs
- GestureRecognizer.cs
- XmlSchemaAttribute.cs
- FileLevelControlBuilderAttribute.cs
- SubMenuStyleCollection.cs