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
- WindowsAltTab.cs
- TextProperties.cs
- StickyNote.cs
- XmlSequenceWriter.cs
- SectionXmlInfo.cs
- COM2IPerPropertyBrowsingHandler.cs
- PreservationFileWriter.cs
- CurrencyManager.cs
- ScopedKnownTypes.cs
- DocumentViewerBaseAutomationPeer.cs
- FixedBufferAttribute.cs
- VisualState.cs
- ipaddressinformationcollection.cs
- DbXmlEnabledProviderManifest.cs
- Endpoint.cs
- TypeReference.cs
- HttpListener.cs
- CharacterBuffer.cs
- CustomAttribute.cs
- RewritingProcessor.cs
- WebBrowserPermission.cs
- Timer.cs
- GridEntry.cs
- DefaultTraceListener.cs
- ParallelEnumerableWrapper.cs
- PointCollection.cs
- HtmlTable.cs
- QueryCacheKey.cs
- ClientFormsIdentity.cs
- SrgsToken.cs
- Operand.cs
- SendActivityValidator.cs
- KeyboardNavigation.cs
- Number.cs
- SerializationAttributes.cs
- AttachedAnnotation.cs
- QueryLifecycle.cs
- VisualStateGroup.cs
- Number.cs
- WebPartConnectionsCancelVerb.cs
- SoapEnumAttribute.cs
- SplitContainer.cs
- SchemaNamespaceManager.cs
- WebEventCodes.cs
- RegularExpressionValidator.cs
- ExtentCqlBlock.cs
- ExpanderAutomationPeer.cs
- GeneralTransform3DGroup.cs
- ColumnResult.cs
- WinFormsComponentEditor.cs
- _SpnDictionary.cs
- WebReferenceOptions.cs
- DefaultEventAttribute.cs
- UpdateManifestForBrowserApplication.cs
- FormsIdentity.cs
- HttpWriter.cs
- ArglessEventHandlerProxy.cs
- DataGridViewCheckBoxCell.cs
- MouseActionValueSerializer.cs
- Selector.cs
- ChoiceConverter.cs
- RuleInfoComparer.cs
- SectionXmlInfo.cs
- DrawListViewColumnHeaderEventArgs.cs
- SerializableAttribute.cs
- Cloud.cs
- ObjectDataSourceSelectingEventArgs.cs
- FocusManager.cs
- _RequestCacheProtocol.cs
- xsdvalidator.cs
- PageSetupDialog.cs
- ObjectPropertyMapping.cs
- XpsFontSubsetter.cs
- CriticalHandle.cs
- FormattedTextSymbols.cs
- CriticalExceptions.cs
- InputReferenceExpression.cs
- SurrogateSelector.cs
- Lookup.cs
- ClientScriptManager.cs
- DuplicateWaitObjectException.cs
- InputLanguageSource.cs
- AsymmetricKeyExchangeFormatter.cs
- MultiByteCodec.cs
- TextModifier.cs
- NumericUpDownAccelerationCollection.cs
- ExpressionLink.cs
- TableLayoutSettings.cs
- WebPartConnectionsCloseVerb.cs
- TextWriterTraceListener.cs
- XmlEntity.cs
- NetWebProxyFinder.cs
- UnmanagedHandle.cs
- ContractMapping.cs
- OdbcParameter.cs
- SoapTransportImporter.cs
- CompModSwitches.cs
- BitmapFrame.cs
- EventTrigger.cs
- AbsoluteQuery.cs