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
- XmlSchemaComplexContent.cs
- DataStorage.cs
- FormViewUpdatedEventArgs.cs
- BindingNavigator.cs
- PersonalizationAdministration.cs
- AliasedExpr.cs
- CacheChildrenQuery.cs
- MaskInputRejectedEventArgs.cs
- QuaternionConverter.cs
- BufferedStream.cs
- TCEAdapterGenerator.cs
- BoolLiteral.cs
- CodeExpressionCollection.cs
- EndCreateSecurityTokenRequest.cs
- XmlSchemaObject.cs
- HttpApplication.cs
- Converter.cs
- FormsAuthenticationCredentials.cs
- CompositeScriptReferenceEventArgs.cs
- DataPointer.cs
- BitmapEffectGroup.cs
- Dispatcher.cs
- FontWeight.cs
- DataGridViewRowPostPaintEventArgs.cs
- Typography.cs
- ConvertTextFrag.cs
- FixedBufferAttribute.cs
- LoadMessageLogger.cs
- XmlFormatExtensionPrefixAttribute.cs
- DirectoryInfo.cs
- ToolStripContainerActionList.cs
- DataStreamFromComStream.cs
- XPathPatternBuilder.cs
- TemplateField.cs
- Pens.cs
- IndentTextWriter.cs
- SingleAnimationBase.cs
- SerializationInfo.cs
- SortKey.cs
- OutputCacheProfile.cs
- WindowsStatic.cs
- ControlOperationBehavior.cs
- UserNameSecurityToken.cs
- ElementAction.cs
- EventHandlersStore.cs
- VectorConverter.cs
- PathFigureCollectionConverter.cs
- ServiceChannelManager.cs
- Binding.cs
- Walker.cs
- UIElementParagraph.cs
- TypeConverterHelper.cs
- ExceptionTrace.cs
- ServerValidateEventArgs.cs
- PersistenceProviderDirectory.cs
- OrElse.cs
- CDSsyncETWBCLProvider.cs
- _PooledStream.cs
- RegexTree.cs
- DataGridTextBox.cs
- ipaddressinformationcollection.cs
- Claim.cs
- BuiltInExpr.cs
- IntranetCredentialPolicy.cs
- OdbcPermission.cs
- SAPIEngineTypes.cs
- PropertyMappingExceptionEventArgs.cs
- RSACryptoServiceProvider.cs
- OverflowException.cs
- InstanceCreationEditor.cs
- JpegBitmapDecoder.cs
- NamespaceInfo.cs
- recordstatescratchpad.cs
- DATA_BLOB.cs
- CodeNamespaceImportCollection.cs
- NTAccount.cs
- PeerCollaboration.cs
- CalculatedColumn.cs
- ServiceObjectContainer.cs
- ToolStripItemTextRenderEventArgs.cs
- OutputWindow.cs
- EmptyControlCollection.cs
- FeatureSupport.cs
- TaskSchedulerException.cs
- AssemblyResolver.cs
- DescendentsWalkerBase.cs
- ReceiveReply.cs
- ISessionStateStore.cs
- PropertyGridCommands.cs
- WebConfigurationFileMap.cs
- WebControlsSection.cs
- AssemblyAttributesGoHere.cs
- StrokeSerializer.cs
- ApplicationActivator.cs
- BinaryWriter.cs
- RuntimeResourceSet.cs
- DBSchemaRow.cs
- DataGridViewComboBoxEditingControl.cs
- Socket.cs
- WebPartAddingEventArgs.cs