Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- FormsAuthenticationUser.cs
- WebPartAddingEventArgs.cs
- wgx_sdk_version.cs
- Avt.cs
- EnumValAlphaComparer.cs
- TableDesigner.cs
- RedBlackList.cs
- EntityProviderServices.cs
- SqlDependencyListener.cs
- UIElement.cs
- GB18030Encoding.cs
- WindowsFont.cs
- TripleDES.cs
- PreviewControlDesigner.cs
- OperationFormatUse.cs
- SafeHandle.cs
- XmlSchemaSimpleTypeUnion.cs
- OutputCacheProfile.cs
- UserPersonalizationStateInfo.cs
- ClientSettingsSection.cs
- RegexCompiler.cs
- WebPartsSection.cs
- UpDownEvent.cs
- KeyPullup.cs
- ProfileSection.cs
- Attributes.cs
- StoreContentChangedEventArgs.cs
- COM2ExtendedBrowsingHandler.cs
- XmlSchemaComplexContentExtension.cs
- XomlCompiler.cs
- CodeAttributeDeclaration.cs
- SqlUDTStorage.cs
- MemberDescriptor.cs
- ValueConversionAttribute.cs
- NamedPermissionSet.cs
- JsonGlobals.cs
- SmtpException.cs
- WsdlBuildProvider.cs
- ClientSettings.cs
- UriTemplateMatch.cs
- EntityCollection.cs
- AnimationStorage.cs
- PnrpPeerResolverBindingElement.cs
- RuntimeIdentifierPropertyAttribute.cs
- SiteMapSection.cs
- HelpFileFileNameEditor.cs
- WebRequestModuleElement.cs
- UrlPath.cs
- ToolbarAUtomationPeer.cs
- DiscreteKeyFrames.cs
- TypeSystem.cs
- baseaxisquery.cs
- CodeConstructor.cs
- GlyphRunDrawing.cs
- DataSourceViewSchemaConverter.cs
- WebPartChrome.cs
- DocumentPageTextView.cs
- MachineSettingsSection.cs
- PointAnimationClockResource.cs
- Pool.cs
- RadioButton.cs
- HtmlControl.cs
- AxisAngleRotation3D.cs
- Size3DValueSerializer.cs
- WorkflowStateRollbackService.cs
- XmlWrappingReader.cs
- SHA512Managed.cs
- DeferredBinaryDeserializerExtension.cs
- DataGridViewRowsAddedEventArgs.cs
- XmlQueryStaticData.cs
- FullTextLine.cs
- FormsAuthenticationCredentials.cs
- InvalidProgramException.cs
- ReadOnlyHierarchicalDataSourceView.cs
- SQLDoubleStorage.cs
- ConsumerConnectionPointCollection.cs
- RadioButton.cs
- Documentation.cs
- CompositeFontInfo.cs
- PathSegment.cs
- FlowLayout.cs
- AggregationMinMaxHelpers.cs
- HttpResponseWrapper.cs
- ColorAnimationBase.cs
- InternalConfigRoot.cs
- SchemaElement.cs
- Baml2006SchemaContext.cs
- DesignerActionUIService.cs
- SqlDataAdapter.cs
- Encoder.cs
- TemplateBamlRecordReader.cs
- AddInIpcChannel.cs
- XmlSchemaImport.cs
- ImageSource.cs
- ComponentChangedEvent.cs
- Lease.cs
- cache.cs
- CompositeDataBoundControl.cs
- HttpListenerRequest.cs
- DefaultAsyncDataDispatcher.cs