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
- SecurityPolicySection.cs
- SoapEnvelopeProcessingElement.cs
- XmlTextReaderImpl.cs
- ConsoleCancelEventArgs.cs
- XmlValidatingReaderImpl.cs
- ColorConvertedBitmap.cs
- OrthographicCamera.cs
- CodeNamespaceCollection.cs
- BindingGroup.cs
- TCPListener.cs
- XmlSchemaAttribute.cs
- SendActivityDesigner.cs
- OneOf.cs
- HtmlInputHidden.cs
- PropertyPushdownHelper.cs
- WebConfigurationHostFileChange.cs
- DocumentsTrace.cs
- AppDomain.cs
- XMLUtil.cs
- Menu.cs
- SystemWebSectionGroup.cs
- ThreadInterruptedException.cs
- FormsAuthenticationTicket.cs
- DataGridViewCellStateChangedEventArgs.cs
- ExeContext.cs
- NameValueConfigurationElement.cs
- TwoPhaseCommit.cs
- ConfigurationElementCollection.cs
- MembershipPasswordException.cs
- CursorConverter.cs
- ConfigurationValue.cs
- DateTimeOffsetStorage.cs
- LifetimeManager.cs
- FaultCallbackWrapper.cs
- PackagePart.cs
- QilParameter.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ProxyWebPartConnectionCollection.cs
- DataGridViewAutoSizeModeEventArgs.cs
- RetrieveVirtualItemEventArgs.cs
- TransactionScope.cs
- KoreanCalendar.cs
- StringHandle.cs
- UnsafeNativeMethods.cs
- GroupBoxRenderer.cs
- PrintingPermissionAttribute.cs
- SmtpFailedRecipientsException.cs
- SessionStateSection.cs
- UIElementPropertyUndoUnit.cs
- TransformerInfo.cs
- FontUnit.cs
- _ServiceNameStore.cs
- ImageMapEventArgs.cs
- StrokeCollectionDefaultValueFactory.cs
- Publisher.cs
- ShaderRenderModeValidation.cs
- ConfigXmlAttribute.cs
- RoamingStoreFile.cs
- validationstate.cs
- InvalidBodyAccessException.cs
- HttpSessionStateWrapper.cs
- OracleParameter.cs
- SqlDependency.cs
- PhysicalFontFamily.cs
- LinkedResourceCollection.cs
- Command.cs
- DPTypeDescriptorContext.cs
- HttpSysSettings.cs
- MaskedTextProvider.cs
- WebProxyScriptElement.cs
- RenderTargetBitmap.cs
- DispatcherProcessingDisabled.cs
- ProvidePropertyAttribute.cs
- RewritingSimplifier.cs
- SystemPens.cs
- Baml2006SchemaContext.cs
- OperationDescriptionCollection.cs
- Padding.cs
- Internal.cs
- SchemaSetCompiler.cs
- MonitoringDescriptionAttribute.cs
- SafeIUnknown.cs
- CellTreeNode.cs
- ClaimComparer.cs
- ToolStripDropDownMenu.cs
- _Connection.cs
- XpsS0ValidatingLoader.cs
- AttachedPropertyBrowsableAttribute.cs
- QuadraticBezierSegment.cs
- ResourceExpressionEditor.cs
- MultiTouchSystemGestureLogic.cs
- NetworkStream.cs
- VectorConverter.cs
- DataViewManagerListItemTypeDescriptor.cs
- ContentWrapperAttribute.cs
- DataGridLinkButton.cs
- ObjectViewEntityCollectionData.cs
- BinaryUtilClasses.cs
- CustomValidator.cs
- XmlDomTextWriter.cs