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
- SqlDataSourceParameterParser.cs
- GetWinFXPath.cs
- InputBindingCollection.cs
- ADConnectionHelper.cs
- BinaryConverter.cs
- IOException.cs
- HostedTransportConfigurationManager.cs
- TypeForwardedToAttribute.cs
- MultiDataTrigger.cs
- SpeechRecognitionEngine.cs
- ItemCheckedEvent.cs
- UpnEndpointIdentityExtension.cs
- IEnumerable.cs
- RijndaelManagedTransform.cs
- SelectingProviderEventArgs.cs
- RegisteredExpandoAttribute.cs
- CategoryGridEntry.cs
- WindowsStartMenu.cs
- InputScopeManager.cs
- NativeActivityMetadata.cs
- SimpleBitVector32.cs
- Base64Encoder.cs
- ProxyWebPart.cs
- ThreadAttributes.cs
- DelegatingTypeDescriptionProvider.cs
- NativeMethods.cs
- HtmlInputPassword.cs
- InstalledFontCollection.cs
- FreeIndexList.cs
- PageAsyncTaskManager.cs
- basecomparevalidator.cs
- AnnotationResourceChangedEventArgs.cs
- DoubleAnimationClockResource.cs
- LeaseManager.cs
- SerializationInfo.cs
- ListenerBinder.cs
- MetadataItemEmitter.cs
- IisTraceListener.cs
- DefaultClaimSet.cs
- CryptoApi.cs
- CompilationUtil.cs
- CacheHelper.cs
- HttpsTransportElement.cs
- IconConverter.cs
- PriorityRange.cs
- shaperfactoryquerycacheentry.cs
- AutoGeneratedFieldProperties.cs
- ValidatingPropertiesEventArgs.cs
- SafeFindHandle.cs
- ManipulationStartedEventArgs.cs
- RtfFormatStack.cs
- XmlSchemaParticle.cs
- EventMap.cs
- RadioButtonStandardAdapter.cs
- MSAANativeProvider.cs
- DeviceContext.cs
- FontStyle.cs
- InlineUIContainer.cs
- XmlDataContract.cs
- Hashtable.cs
- AttachedPropertyMethodSelector.cs
- TransactionManager.cs
- SpeakProgressEventArgs.cs
- IdnMapping.cs
- DragDropManager.cs
- SqlVisitor.cs
- SplitterCancelEvent.cs
- Message.cs
- SystemResourceKey.cs
- XmlFormatExtensionAttribute.cs
- UpDownBaseDesigner.cs
- ResourceReferenceExpression.cs
- PackageRelationship.cs
- DefaultValueAttribute.cs
- StylusPointPropertyId.cs
- Rfc2898DeriveBytes.cs
- SafeFreeMibTable.cs
- FilteredXmlReader.cs
- Directory.cs
- FullTextLine.cs
- PlaceHolder.cs
- WsatConfiguration.cs
- ArcSegment.cs
- PreProcessInputEventArgs.cs
- RecognizerInfo.cs
- RestHandler.cs
- AsyncSerializedWorker.cs
- StatusBarPanel.cs
- NonBatchDirectoryCompiler.cs
- UserUseLicenseDictionaryLoader.cs
- DataGridViewBindingCompleteEventArgs.cs
- _LazyAsyncResult.cs
- Int64Converter.cs
- ToolStripDropDownClosedEventArgs.cs
- UseAttributeSetsAction.cs
- AutomationTextAttribute.cs
- DoubleUtil.cs
- WebPartDisplayMode.cs
- ComponentDispatcherThread.cs
- XmlLangPropertyAttribute.cs