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
- XmlDataImplementation.cs
- UnsafeNativeMethods.cs
- OleDbDataAdapter.cs
- URL.cs
- CurrentChangedEventManager.cs
- SHA384Cng.cs
- AddressingProperty.cs
- RoutedPropertyChangedEventArgs.cs
- ISAPIWorkerRequest.cs
- Pair.cs
- PageThemeCodeDomTreeGenerator.cs
- NotifyParentPropertyAttribute.cs
- ItemCheckEvent.cs
- EditorServiceContext.cs
- AddressHeaderCollection.cs
- RectangleF.cs
- AbandonedMutexException.cs
- TypedElement.cs
- DataFormats.cs
- GZipStream.cs
- OracleConnectionFactory.cs
- Clock.cs
- XPathMultyIterator.cs
- SessionPageStateSection.cs
- EventlogProvider.cs
- ManifestSignatureInformation.cs
- PixelFormatConverter.cs
- LeafCellTreeNode.cs
- CanonicalFontFamilyReference.cs
- DesignerAttributeInfo.cs
- httpapplicationstate.cs
- AddDataControlFieldDialog.cs
- _ListenerRequestStream.cs
- QilValidationVisitor.cs
- CapacityStreamGeometryContext.cs
- DataRowView.cs
- TCEAdapterGenerator.cs
- webbrowsersite.cs
- AncestorChangedEventArgs.cs
- GcHandle.cs
- GZipDecoder.cs
- TextServicesDisplayAttribute.cs
- ParseElementCollection.cs
- TypedReference.cs
- DrawListViewItemEventArgs.cs
- RemotingException.cs
- XmlSchemas.cs
- PageSettings.cs
- SelectionPattern.cs
- ChtmlFormAdapter.cs
- SafeFileMappingHandle.cs
- GridViewUpdateEventArgs.cs
- RecognizerBase.cs
- CharacterString.cs
- RenderTargetBitmap.cs
- DataGridViewComboBoxColumn.cs
- SkinBuilder.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ComponentEvent.cs
- UnescapedXmlDiagnosticData.cs
- DropSourceBehavior.cs
- HyperLinkColumn.cs
- HttpCacheParams.cs
- RoleServiceManager.cs
- UnsafeNativeMethods.cs
- CapabilitiesPattern.cs
- SQLInt64.cs
- TabletDeviceInfo.cs
- SafeEventLogReadHandle.cs
- BindToObject.cs
- PriorityBindingExpression.cs
- TdsParser.cs
- TableDesigner.cs
- CapabilitiesRule.cs
- SR.cs
- IndexedGlyphRun.cs
- _IPv4Address.cs
- PageThemeParser.cs
- ReaderWriterLockWrapper.cs
- DbExpressionVisitor.cs
- InputProviderSite.cs
- WasEndpointConfigContainer.cs
- SqlProfileProvider.cs
- EventItfInfo.cs
- Effect.cs
- WorkflowInstanceUnhandledExceptionRecord.cs
- SecurityMode.cs
- SrgsRulesCollection.cs
- StateInitializationDesigner.cs
- BindingListCollectionView.cs
- SchemaEntity.cs
- connectionpool.cs
- BitmapEditor.cs
- Pointer.cs
- DataSourceSelectArguments.cs
- MethodInfo.cs
- ExpressionNode.cs
- LiteralTextContainerControlBuilder.cs
- WebControlsSection.cs
- XmlSchemaAttributeGroupRef.cs