Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Buffer.cs
- DesignSurface.cs
- PageThemeBuildProvider.cs
- SafeHandles.cs
- AmbientLight.cs
- DateTimeValueSerializer.cs
- XmlWrappingReader.cs
- ProvidersHelper.cs
- SqlUDTStorage.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- GZipUtils.cs
- SiteMapHierarchicalDataSourceView.cs
- XamlPointCollectionSerializer.cs
- DirectoryLocalQuery.cs
- _CacheStreams.cs
- ObjectCacheSettings.cs
- ToolBar.cs
- TemplatedMailWebEventProvider.cs
- ExpressionVisitor.cs
- DesignTimeVisibleAttribute.cs
- HostingPreferredMapPath.cs
- KeyedHashAlgorithm.cs
- Ops.cs
- XmlText.cs
- DataGridLengthConverter.cs
- PageAsyncTaskManager.cs
- PeerToPeerException.cs
- WCFModelStrings.Designer.cs
- mediapermission.cs
- WebPartConnectionsConnectVerb.cs
- SqlUtils.cs
- Part.cs
- DispatcherFrame.cs
- PreloadHost.cs
- FixedSOMTable.cs
- XmlCharCheckingWriter.cs
- FixedSOMLineCollection.cs
- ExpressionBinding.cs
- PersistChildrenAttribute.cs
- DataGridViewCellStyle.cs
- SetIndexBinder.cs
- BitmapVisualManager.cs
- InvalidOperationException.cs
- CaseInsensitiveHashCodeProvider.cs
- MouseOverProperty.cs
- Crypto.cs
- SelectedGridItemChangedEvent.cs
- DataGridItemCollection.cs
- PackageRelationship.cs
- MainMenu.cs
- TemplateField.cs
- EntityDataSourceUtil.cs
- AssemblyAttributes.cs
- SslStreamSecurityBindingElement.cs
- SiteMapDataSource.cs
- IImplicitResourceProvider.cs
- FocusTracker.cs
- IPeerNeighbor.cs
- BroadcastEventHelper.cs
- VectorCollection.cs
- Literal.cs
- FromReply.cs
- FlowLayout.cs
- WindowsAuthenticationModule.cs
- GenericAuthenticationEventArgs.cs
- ListViewPagedDataSource.cs
- Subtree.cs
- SmiEventSink_Default.cs
- StyleSelector.cs
- StorageFunctionMapping.cs
- TabPanel.cs
- ClaimSet.cs
- ServiceHostingEnvironment.cs
- WebBrowser.cs
- TokenizerHelper.cs
- ToolStripOverflowButton.cs
- XmlWrappingReader.cs
- DbBuffer.cs
- SmiTypedGetterSetter.cs
- ProfessionalColors.cs
- StreamUpgradeInitiator.cs
- ButtonBase.cs
- Composition.cs
- BindingManagerDataErrorEventArgs.cs
- RawAppCommandInputReport.cs
- _CookieModule.cs
- InputBindingCollection.cs
- FileLevelControlBuilderAttribute.cs
- XsltArgumentList.cs
- GridItemPatternIdentifiers.cs
- MenuScrollingVisibilityConverter.cs
- PointHitTestResult.cs
- _AuthenticationState.cs
- EditorPartCollection.cs
- SafeNativeMethods.cs
- NonVisualControlAttribute.cs
- LabelLiteral.cs
- DefaultMemberAttribute.cs
- KoreanLunisolarCalendar.cs
- DecoderNLS.cs