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
- XmlDictionaryReaderQuotas.cs
- ScriptResourceMapping.cs
- QueryAsyncResult.cs
- ReliableChannelListener.cs
- ItemAutomationPeer.cs
- DrawingGroup.cs
- SafeMILHandle.cs
- TextEditorContextMenu.cs
- SBCSCodePageEncoding.cs
- DoubleAnimationBase.cs
- ActivationArguments.cs
- TextContainerHelper.cs
- SevenBitStream.cs
- LinkTarget.cs
- SystemColorTracker.cs
- Span.cs
- DataGridViewUtilities.cs
- ItemsControlAutomationPeer.cs
- UnionExpr.cs
- SocketElement.cs
- FamilyMap.cs
- WindowsStatic.cs
- namescope.cs
- DynamicActivity.cs
- InputBinder.cs
- WebPartConnectionsConfigureVerb.cs
- RowUpdatingEventArgs.cs
- GridViewEditEventArgs.cs
- RectAnimationBase.cs
- PassportIdentity.cs
- TrackBarRenderer.cs
- XmlSchemaChoice.cs
- SqlProcedureAttribute.cs
- GCHandleCookieTable.cs
- __Filters.cs
- EnumerableValidator.cs
- GridViewDeletedEventArgs.cs
- metadatamappinghashervisitor.cs
- FrugalList.cs
- ChtmlCommandAdapter.cs
- CodeSubDirectoriesCollection.cs
- NameNode.cs
- PlatformCulture.cs
- LinkConverter.cs
- WorkflowDesignerMessageFilter.cs
- WindowsGraphicsWrapper.cs
- VBCodeProvider.cs
- Pkcs7Signer.cs
- WindowShowOrOpenTracker.cs
- FillErrorEventArgs.cs
- EntityDataSourceWrapperCollection.cs
- TaskFormBase.cs
- DeploymentSection.cs
- DynamicDataResources.Designer.cs
- XmlReflectionImporter.cs
- ResourceContainer.cs
- Encoder.cs
- GridItem.cs
- XPathNodeIterator.cs
- FontStyle.cs
- AddInBase.cs
- FloaterBaseParagraph.cs
- ListItemViewAttribute.cs
- ControlAdapter.cs
- SweepDirectionValidation.cs
- dbdatarecord.cs
- UInt32Storage.cs
- Int64AnimationBase.cs
- WebPartDeleteVerb.cs
- XmlNamespaceDeclarationsAttribute.cs
- Block.cs
- PassportIdentity.cs
- ImpersonationContext.cs
- ServiceChannelManager.cs
- ZoneMembershipCondition.cs
- StructuredTypeEmitter.cs
- SpecularMaterial.cs
- ContentPlaceHolder.cs
- Panel.cs
- MenuItemBinding.cs
- Base64Stream.cs
- SafeRightsManagementQueryHandle.cs
- DispatchWrapper.cs
- SpinWait.cs
- XmlSchemaSimpleTypeUnion.cs
- Wizard.cs
- ContractSearchPattern.cs
- PageAsyncTaskManager.cs
- EventOpcode.cs
- ListManagerBindingsCollection.cs
- RuntimeArgumentHandle.cs
- DataContractFormatAttribute.cs
- IndexedEnumerable.cs
- DataGridItemEventArgs.cs
- InstanceKeyNotReadyException.cs
- StateMachineSubscriptionManager.cs
- DataObject.cs
- WsatTransactionInfo.cs
- DoubleLinkListEnumerator.cs
- XmlDigitalSignatureProcessor.cs