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
- ClientTargetSection.cs
- UpnEndpointIdentityExtension.cs
- CompilerCollection.cs
- HttpDebugHandler.cs
- GetRecipientRequest.cs
- DocumentSequence.cs
- ToolStripDropDownItem.cs
- TimeSpanSecondsConverter.cs
- DataView.cs
- NavigatingCancelEventArgs.cs
- InputLangChangeRequestEvent.cs
- Visitors.cs
- TemplateBamlRecordReader.cs
- GeneralTransformGroup.cs
- AtomPub10ServiceDocumentFormatter.cs
- EntityTypeEmitter.cs
- FillBehavior.cs
- ServiceEndpoint.cs
- NativeCppClassAttribute.cs
- SoapFormatter.cs
- RectIndependentAnimationStorage.cs
- _Connection.cs
- CacheOutputQuery.cs
- LocationSectionRecord.cs
- DesignTimeTemplateParser.cs
- ControlParser.cs
- GcSettings.cs
- WebPartMenuStyle.cs
- HeaderedItemsControl.cs
- SQLByteStorage.cs
- ModifiableIteratorCollection.cs
- Visitor.cs
- HotSpotCollection.cs
- DockPattern.cs
- TextPointerBase.cs
- SelectionUIHandler.cs
- DataGridViewAutoSizeModeEventArgs.cs
- RemotingException.cs
- DataKeyCollection.cs
- Range.cs
- TcpChannelListener.cs
- OutputCache.cs
- SymbolPair.cs
- HintTextConverter.cs
- TextTreeTextBlock.cs
- EntityCommandDefinition.cs
- OrCondition.cs
- MD5CryptoServiceProvider.cs
- Version.cs
- TabOrder.cs
- QuaternionRotation3D.cs
- XmlQueryOutput.cs
- MbpInfo.cs
- Symbol.cs
- UnauthorizedWebPart.cs
- DependencyPropertyKey.cs
- DesignerLoader.cs
- SchemaObjectWriter.cs
- HandleExceptionArgs.cs
- RegexCapture.cs
- COAUTHINFO.cs
- WindowsFormsSynchronizationContext.cs
- ScriptingProfileServiceSection.cs
- ProxySimple.cs
- ServiceNotStartedException.cs
- FrameworkReadOnlyPropertyMetadata.cs
- SHA512.cs
- LoginName.cs
- WebControlParameterProxy.cs
- SmiEventSink_Default.cs
- XmlSchemaAnnotated.cs
- Int32Rect.cs
- UserControlParser.cs
- DynamicRenderer.cs
- securitycriticaldataformultiplegetandset.cs
- PropertyEmitterBase.cs
- XmlTextReaderImplHelpers.cs
- PiiTraceSource.cs
- QueryHandler.cs
- ConfigXmlAttribute.cs
- XmlSchemaComplexContentRestriction.cs
- XmlSchemaAttributeGroup.cs
- BadImageFormatException.cs
- SafeUserTokenHandle.cs
- RequestUriProcessor.cs
- StylesEditorDialog.cs
- CssStyleCollection.cs
- CodeAttachEventStatement.cs
- ApplicationBuildProvider.cs
- Transform3D.cs
- WeakEventManager.cs
- SQLRoleProvider.cs
- NumberSubstitution.cs
- Path.cs
- CharStorage.cs
- KerberosSecurityTokenAuthenticator.cs
- SapiRecognizer.cs
- DataFormats.cs
- StateManagedCollection.cs
- ReadWriteSpinLock.cs