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
- ICollection.cs
- RectAnimation.cs
- WhitespaceRule.cs
- XamlPathDataSerializer.cs
- VerificationException.cs
- dbenumerator.cs
- CodeGenerator.cs
- Range.cs
- Stroke.cs
- XsdCachingReader.cs
- DataSourceViewSchemaConverter.cs
- UnsafeNativeMethods.cs
- StylusPlugin.cs
- TextServicesContext.cs
- SqlUDTStorage.cs
- KeyInterop.cs
- PrtCap_Builder.cs
- VectorKeyFrameCollection.cs
- HtmlInputReset.cs
- ToolStripProgressBar.cs
- ErrorProvider.cs
- HttpVersion.cs
- DataBindingCollection.cs
- DefaultMemberAttribute.cs
- ComponentDispatcherThread.cs
- XmlSchemaSequence.cs
- DetailsViewDesigner.cs
- HttpListenerElement.cs
- ManifestSignedXml.cs
- BrowserCapabilitiesFactory.cs
- WorkflowInstanceProvider.cs
- TileBrush.cs
- ProfileModule.cs
- PageClientProxyGenerator.cs
- DrawingImage.cs
- XPathNodePointer.cs
- AttachmentCollection.cs
- ListViewCancelEventArgs.cs
- DropDownButton.cs
- ComponentConverter.cs
- HttpVersion.cs
- FileInfo.cs
- GridViewColumnHeader.cs
- ISO2022Encoding.cs
- ObjectConverter.cs
- SubpageParaClient.cs
- InvalidAsynchronousStateException.cs
- PointF.cs
- ConvertBinder.cs
- MouseButtonEventArgs.cs
- RelationshipNavigation.cs
- CorrelationActionMessageFilter.cs
- PolyBezierSegment.cs
- TreeView.cs
- AttributeUsageAttribute.cs
- FunctionMappingTranslator.cs
- RawStylusInputCustomDataList.cs
- MsmqIntegrationProcessProtocolHandler.cs
- StringTraceRecord.cs
- ResolveNextArgumentWorkItem.cs
- CheckBox.cs
- Int32Animation.cs
- DocumentManager.cs
- SqlDeflator.cs
- DefaultDialogButtons.cs
- EntityContainer.cs
- UIElement.cs
- SqlConnectionHelper.cs
- DispatchWrapper.cs
- LabelLiteral.cs
- ProxySimple.cs
- XmlChoiceIdentifierAttribute.cs
- JoinGraph.cs
- AuthorizationRule.cs
- HMACSHA384.cs
- ActivityExecutor.cs
- SemanticResolver.cs
- WebCategoryAttribute.cs
- QEncodedStream.cs
- XmlSchemaSimpleTypeUnion.cs
- ToolStripItemImageRenderEventArgs.cs
- BindingElementExtensionElement.cs
- ServiceModelInstallComponent.cs
- AppSecurityManager.cs
- FlowDocument.cs
- ObjectConverter.cs
- DbParameterCollectionHelper.cs
- WinFormsComponentEditor.cs
- Point3DCollection.cs
- StagingAreaInputItem.cs
- EnumBuilder.cs
- Pts.cs
- GatewayDefinition.cs
- Utility.cs
- WebPartConnectVerb.cs
- StyleCollection.cs
- Expressions.cs
- LazyLoadBehavior.cs
- StringPropertyBuilder.cs
- SystemColorTracker.cs