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
- SelectorItemAutomationPeer.cs
- ErrorWebPart.cs
- StateBag.cs
- ProfilePropertyNameValidator.cs
- WebPartUserCapability.cs
- TouchesOverProperty.cs
- NewItemsContextMenuStrip.cs
- SubqueryRules.cs
- Predicate.cs
- AsymmetricKeyExchangeDeformatter.cs
- xmlfixedPageInfo.cs
- PropertyConverter.cs
- sqlpipe.cs
- NumberSubstitution.cs
- AncillaryOps.cs
- UnauthorizedWebPart.cs
- DateTimeConverter.cs
- CompilationUtil.cs
- DataFormats.cs
- Int32RectConverter.cs
- MetadataArtifactLoaderCompositeResource.cs
- SmtpLoginAuthenticationModule.cs
- DataExpression.cs
- MouseBinding.cs
- HiddenField.cs
- OracleSqlParser.cs
- VectorValueSerializer.cs
- Rectangle.cs
- PinnedBufferMemoryStream.cs
- coordinator.cs
- ReadOnlyTernaryTree.cs
- RegexWorker.cs
- IntSecurity.cs
- ComNativeDescriptor.cs
- EntityProviderServices.cs
- VirtualPathProvider.cs
- ConfigXmlComment.cs
- DefaultValueAttribute.cs
- HttpContextWrapper.cs
- DataSvcMapFile.cs
- CompressedStack.cs
- SaveFileDialog.cs
- SqlBulkCopyColumnMappingCollection.cs
- SmtpLoginAuthenticationModule.cs
- SessionStateUtil.cs
- _DisconnectOverlappedAsyncResult.cs
- RtfFormatStack.cs
- SqlHelper.cs
- UrlAuthorizationModule.cs
- Memoizer.cs
- PolygonHotSpot.cs
- PersonalizationState.cs
- HttpNamespaceReservationInstallComponent.cs
- Errors.cs
- ScriptControl.cs
- DataTableMappingCollection.cs
- Win32PrintDialog.cs
- WebPartDisplayModeCancelEventArgs.cs
- FaultContractAttribute.cs
- ISessionStateStore.cs
- Debug.cs
- HtmlImage.cs
- GlyphElement.cs
- TemplateControlCodeDomTreeGenerator.cs
- messageonlyhwndwrapper.cs
- Schema.cs
- SystemTcpConnection.cs
- EnumConverter.cs
- EventLogger.cs
- AddInServer.cs
- AspNetHostingPermission.cs
- AliasExpr.cs
- _UriSyntax.cs
- DBConnectionString.cs
- TextTreeObjectNode.cs
- Vertex.cs
- ZoneIdentityPermission.cs
- ThaiBuddhistCalendar.cs
- ContainerUIElement3D.cs
- WebPartEditorOkVerb.cs
- SQLMoney.cs
- InstalledVoice.cs
- TypeConverter.cs
- QilScopedVisitor.cs
- FileSystemWatcher.cs
- SingleKeyFrameCollection.cs
- SmiMetaDataProperty.cs
- CreationContext.cs
- TextElementAutomationPeer.cs
- PropertyGeneratedEventArgs.cs
- Bidi.cs
- CreateParams.cs
- SR.cs
- VersionedStream.cs
- InvokePattern.cs
- HttpHandlerActionCollection.cs
- SqlCharStream.cs
- Vector3DAnimation.cs
- XmlSchemaValidationException.cs
- IndexOutOfRangeException.cs