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
- FlowLayoutSettings.cs
- CustomErrorsSectionWrapper.cs
- ResourcesGenerator.cs
- GridProviderWrapper.cs
- AuthenticateEventArgs.cs
- wgx_render.cs
- PointCollectionValueSerializer.cs
- ImageMapEventArgs.cs
- ReliableSession.cs
- CodeTypeReferenceExpression.cs
- MailBnfHelper.cs
- CultureSpecificStringDictionary.cs
- NamedPipeProcessProtocolHandler.cs
- InstanceValue.cs
- SupportsPreviewControlAttribute.cs
- SiteMapDataSourceDesigner.cs
- XmlnsDictionary.cs
- TextAdaptor.cs
- ReflectionTypeLoadException.cs
- XmlSchemaSearchPattern.cs
- WebException.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- WebPartZoneCollection.cs
- RichTextBoxConstants.cs
- FrugalMap.cs
- TreeViewItem.cs
- CurrentTimeZone.cs
- SQLInt16Storage.cs
- SamlSerializer.cs
- X509CertificateCollection.cs
- CommandBindingCollection.cs
- CheckBox.cs
- ClientOptions.cs
- StandardOleMarshalObject.cs
- Stopwatch.cs
- MeasureItemEvent.cs
- ConfigXmlAttribute.cs
- SettingsAttributes.cs
- HitTestParameters3D.cs
- LinkButton.cs
- TextPointerBase.cs
- DetailsViewDeletedEventArgs.cs
- CaseStatement.cs
- HTTPRemotingHandler.cs
- _LocalDataStore.cs
- Point3DCollection.cs
- Configuration.cs
- BitArray.cs
- smtppermission.cs
- RelationshipConverter.cs
- PrinterSettings.cs
- DisableDpiAwarenessAttribute.cs
- BuildProvidersCompiler.cs
- ChangePasswordAutoFormat.cs
- EventHandlerService.cs
- GradientStopCollection.cs
- XmlMtomReader.cs
- ArrayWithOffset.cs
- X509ChainElement.cs
- AssemblyResolver.cs
- IndexedString.cs
- WorkflowDesigner.cs
- HtmlInputText.cs
- SHA1CryptoServiceProvider.cs
- DataFormats.cs
- TextParagraph.cs
- StreamUpgradeProvider.cs
- SelectedDatesCollection.cs
- ParseElement.cs
- XhtmlBasicValidatorAdapter.cs
- GridViewSortEventArgs.cs
- HotSpotCollectionEditor.cs
- PersonalizationStateQuery.cs
- AutoSizeToolBoxItem.cs
- XmlSchemaComplexContentExtension.cs
- WebServicesDescriptionAttribute.cs
- FocusTracker.cs
- PointLight.cs
- DoubleCollectionConverter.cs
- ParameterCollection.cs
- DataGridBoolColumn.cs
- TableItemStyle.cs
- DependencyPropertyChangedEventArgs.cs
- WsatServiceCertificate.cs
- Pointer.cs
- InternalUserCancelledException.cs
- LastQueryOperator.cs
- XPathEmptyIterator.cs
- PointAnimationClockResource.cs
- HttpServerProtocol.cs
- SecureUICommand.cs
- CommentGlyph.cs
- BookmarkEventArgs.cs
- XmlSignatureProperties.cs
- UrlMappingCollection.cs
- FunctionMappingTranslator.cs
- BitmapCodecInfoInternal.cs
- ServiceXNameTypeConverter.cs
- VisualTreeUtils.cs
- SafeSecurityHandles.cs