Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- InArgument.cs
- FilteredSchemaElementLookUpTable.cs
- HtmlControl.cs
- MailAddressCollection.cs
- HttpStreamFormatter.cs
- ErrorCodes.cs
- EntityDataSourceStatementEditor.cs
- Transactions.cs
- TextLine.cs
- Rect3D.cs
- WaitForChangedResult.cs
- LocalValueEnumerator.cs
- ReadOnlyTernaryTree.cs
- Dispatcher.cs
- ConnectionsZoneDesigner.cs
- CodeAttributeDeclaration.cs
- CheckedPointers.cs
- JavaScriptSerializer.cs
- ScriptingWebServicesSectionGroup.cs
- HexParser.cs
- DetailsViewCommandEventArgs.cs
- GlyphElement.cs
- PropertyNames.cs
- DoubleCollection.cs
- TagPrefixInfo.cs
- UnaryOperationBinder.cs
- XmlAtomicValue.cs
- SettingsPropertyValue.cs
- RemotingConfigParser.cs
- CodeSubDirectory.cs
- UTF32Encoding.cs
- AdPostCacheSubstitution.cs
- wgx_sdk_version.cs
- DataGridParentRows.cs
- X500Name.cs
- LogicalExpr.cs
- RegisteredExpandoAttribute.cs
- VirtualDirectoryMappingCollection.cs
- DiffuseMaterial.cs
- SmiRecordBuffer.cs
- CommandDevice.cs
- DbConvert.cs
- RadioButtonRenderer.cs
- String.cs
- AttachedPropertyBrowsableAttribute.cs
- DataTableExtensions.cs
- CompensationTokenData.cs
- SmiRecordBuffer.cs
- CLRBindingWorker.cs
- StrokeIntersection.cs
- TaskFileService.cs
- DefaultPropertiesToSend.cs
- UnsafeNativeMethods.cs
- FtpRequestCacheValidator.cs
- ValidationSummary.cs
- FocusTracker.cs
- BevelBitmapEffect.cs
- ZipIOExtraFieldPaddingElement.cs
- HtmlControlDesigner.cs
- HandledMouseEvent.cs
- KerberosRequestorSecurityTokenAuthenticator.cs
- DocumentOrderComparer.cs
- DataSourceControl.cs
- DataGridViewControlCollection.cs
- _SSPIWrapper.cs
- NativeMethods.cs
- PartialTrustVisibleAssembliesSection.cs
- WsiProfilesElement.cs
- CommandField.cs
- WorkflowInstance.cs
- Point3D.cs
- _AutoWebProxyScriptWrapper.cs
- XmlSerializationReader.cs
- DocumentGridContextMenu.cs
- GridViewItemAutomationPeer.cs
- ChtmlSelectionListAdapter.cs
- DynamicPropertyHolder.cs
- PageThemeBuildProvider.cs
- QualifierSet.cs
- State.cs
- GridViewRow.cs
- TextLine.cs
- LiteralDesigner.cs
- _CacheStreams.cs
- ReliabilityContractAttribute.cs
- DataServiceRequestArgs.cs
- NumberSubstitution.cs
- BaseCodeDomTreeGenerator.cs
- PenLineCapValidation.cs
- ProcessHostMapPath.cs
- TypeDescriptor.cs
- TabItem.cs
- DataReaderContainer.cs
- DbSourceCommand.cs
- KnownTypesHelper.cs
- DetailsViewPagerRow.cs
- MarkupCompiler.cs
- SamlConstants.cs
- XmlSchemaComplexContentRestriction.cs
- xdrvalidator.cs