Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Configuration / System / Configuration / ConfigurationSection.cs / 1 / ConfigurationSection.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Configuration {
using System;
using System.Collections.Specialized;
using System.Configuration.Internal;
using System.IO;
using System.Reflection;
using System.Security;
using System.Text;
using System.Xml;
using System.Globalization;
public abstract class ConfigurationSection : ConfigurationElement {
private SectionInformation _section;
// Constructor
//
protected ConfigurationSection() {
_section = new SectionInformation( this );
}
// SectionInformation property
//
// Retrieve the class associated with the Section information
//
public SectionInformation SectionInformation {
get {
return _section;
}
}
// GetRuntimeObject
//
// Return the Runtime Object for this Section
//
protected internal virtual object GetRuntimeObject() {
return this;
}
protected internal override bool IsModified() {
return ( SectionInformation.IsModifiedFlags() ||
base.IsModified() );
}
protected internal override void ResetModified() {
SectionInformation.ResetModifiedFlags();
base.ResetModified();
}
protected internal virtual void DeserializeSection(XmlReader reader) {
if (!reader.Read() || reader.NodeType != XmlNodeType.Element) {
throw new ConfigurationErrorsException(SR.GetString(SR.Config_base_expected_to_find_element), reader);
}
DeserializeElement(reader, false);
}
protected internal virtual string SerializeSection(ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode) {
ValidateElement(this, null, true);
ConfigurationElement TempElement = CreateElement(this.GetType());
TempElement.Unmerge(this, parentElement, saveMode);
StringWriter strWriter = new StringWriter(CultureInfo.InvariantCulture);
XmlTextWriter writer = new XmlTextWriter(strWriter);
writer.Formatting = Formatting.Indented;
writer.Indentation = 4;
writer.IndentChar = ' ';
TempElement.DataToWriteInternal = (saveMode != ConfigurationSaveMode.Minimal);
TempElement.SerializeToXmlElement(writer, name);
writer.Flush();
return strWriter.ToString();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Configuration {
using System;
using System.Collections.Specialized;
using System.Configuration.Internal;
using System.IO;
using System.Reflection;
using System.Security;
using System.Text;
using System.Xml;
using System.Globalization;
public abstract class ConfigurationSection : ConfigurationElement {
private SectionInformation _section;
// Constructor
//
protected ConfigurationSection() {
_section = new SectionInformation( this );
}
// SectionInformation property
//
// Retrieve the class associated with the Section information
//
public SectionInformation SectionInformation {
get {
return _section;
}
}
// GetRuntimeObject
//
// Return the Runtime Object for this Section
//
protected internal virtual object GetRuntimeObject() {
return this;
}
protected internal override bool IsModified() {
return ( SectionInformation.IsModifiedFlags() ||
base.IsModified() );
}
protected internal override void ResetModified() {
SectionInformation.ResetModifiedFlags();
base.ResetModified();
}
protected internal virtual void DeserializeSection(XmlReader reader) {
if (!reader.Read() || reader.NodeType != XmlNodeType.Element) {
throw new ConfigurationErrorsException(SR.GetString(SR.Config_base_expected_to_find_element), reader);
}
DeserializeElement(reader, false);
}
protected internal virtual string SerializeSection(ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode) {
ValidateElement(this, null, true);
ConfigurationElement TempElement = CreateElement(this.GetType());
TempElement.Unmerge(this, parentElement, saveMode);
StringWriter strWriter = new StringWriter(CultureInfo.InvariantCulture);
XmlTextWriter writer = new XmlTextWriter(strWriter);
writer.Formatting = Formatting.Indented;
writer.Indentation = 4;
writer.IndentChar = ' ';
TempElement.DataToWriteInternal = (saveMode != ConfigurationSaveMode.Minimal);
TempElement.SerializeToXmlElement(writer, name);
writer.Flush();
return strWriter.ToString();
}
}
}
// 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
- ListBoxItemWrapperAutomationPeer.cs
- Itemizer.cs
- RootAction.cs
- SequenceNumber.cs
- EventLog.cs
- FastPropertyAccessor.cs
- TargetFrameworkAttribute.cs
- ChildChangedEventArgs.cs
- InvariantComparer.cs
- TableRowCollection.cs
- FormViewRow.cs
- StructuralType.cs
- PasswordTextContainer.cs
- Buffer.cs
- WindowsListBox.cs
- XmlRootAttribute.cs
- TreeIterator.cs
- XmlTextAttribute.cs
- GridItemProviderWrapper.cs
- MenuAutomationPeer.cs
- HostingMessageProperty.cs
- PointLightBase.cs
- TreeBuilderXamlTranslator.cs
- WebPartActionVerb.cs
- Command.cs
- DataGridItemEventArgs.cs
- SqlExpander.cs
- SoapInteropTypes.cs
- IncrementalReadDecoders.cs
- SafeTokenHandle.cs
- ProtocolsConfigurationHandler.cs
- XmlSchemaGroup.cs
- EndpointAddressAugust2004.cs
- DataGridViewElement.cs
- ServiceModelConfigurationElementCollection.cs
- ConsumerConnectionPoint.cs
- XmlUtf8RawTextWriter.cs
- IntegerValidator.cs
- CompModSwitches.cs
- RewritingProcessor.cs
- TimeSpanValidator.cs
- LocalizableResourceBuilder.cs
- ParameterBuilder.cs
- PointValueSerializer.cs
- QuestionEventArgs.cs
- LocalClientSecuritySettings.cs
- ParsedAttributeCollection.cs
- GraphicsPath.cs
- RemotingAttributes.cs
- ProtectedProviderSettings.cs
- WindowsStartMenu.cs
- TextBreakpoint.cs
- IDispatchConstantAttribute.cs
- SqlDataSourceCommandEventArgs.cs
- SByteStorage.cs
- WebPart.cs
- TextWriterTraceListener.cs
- Debug.cs
- NotificationContext.cs
- IUnknownConstantAttribute.cs
- ByteAnimationBase.cs
- AutoGeneratedFieldProperties.cs
- DescriptionCreator.cs
- ComplexTypeEmitter.cs
- MDIWindowDialog.cs
- XmlRootAttribute.cs
- CodeIndexerExpression.cs
- XDeferredAxisSource.cs
- DocumentViewerAutomationPeer.cs
- XsltFunctions.cs
- EdmSchemaAttribute.cs
- UserMapPath.cs
- HostUtils.cs
- ComponentEditorForm.cs
- HuffmanTree.cs
- GridItemPatternIdentifiers.cs
- ButtonBase.cs
- ProfileModule.cs
- FormattedText.cs
- SByteStorage.cs
- DataControlReference.cs
- DrawingVisual.cs
- JsonDataContract.cs
- ClientRuntime.cs
- QuestionEventArgs.cs
- DtrList.cs
- FlowDocument.cs
- AssociationEndMember.cs
- KerberosSecurityTokenProvider.cs
- EventBuilder.cs
- DataGridColumnCollectionEditor.cs
- CacheAxisQuery.cs
- XPathItem.cs
- Variable.cs
- WebConfigurationManager.cs
- LongValidatorAttribute.cs
- WebControl.cs
- OdbcReferenceCollection.cs
- TypeToArgumentTypeConverter.cs
- JournalEntryListConverter.cs