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
- ColorAnimationBase.cs
- ComponentSerializationService.cs
- CacheMemory.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- Vars.cs
- ScrollBarAutomationPeer.cs
- Tuple.cs
- StringUtil.cs
- EventLog.cs
- UnsafeNativeMethods.cs
- HtmlCalendarAdapter.cs
- DoWorkEventArgs.cs
- DataObjectFieldAttribute.cs
- SelectionProviderWrapper.cs
- RemotingAttributes.cs
- ReliableInputConnection.cs
- Message.cs
- ArrayExtension.cs
- Attribute.cs
- MachinePropertyVariants.cs
- TraceAsyncResult.cs
- TreeNode.cs
- ClientSideProviderDescription.cs
- ErrorTableItemStyle.cs
- EndEvent.cs
- ConstNode.cs
- PointAnimationUsingPath.cs
- Single.cs
- SubclassTypeValidatorAttribute.cs
- QueryParameter.cs
- DataGridViewColumnConverter.cs
- MenuItemBindingCollection.cs
- Claim.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- IPAddressCollection.cs
- BitVector32.cs
- DateTimeValueSerializerContext.cs
- OleDbException.cs
- OutOfMemoryException.cs
- SelfIssuedSamlTokenFactory.cs
- ClientSettingsStore.cs
- GuidelineSet.cs
- DatasetMethodGenerator.cs
- BitmapEffectInput.cs
- OrderToken.cs
- PropertiesTab.cs
- ObjectResult.cs
- CqlParserHelpers.cs
- WebControl.cs
- TypeConstant.cs
- Invariant.cs
- ToolBarOverflowPanel.cs
- ThicknessConverter.cs
- PropertyGeneratedEventArgs.cs
- Section.cs
- FamilyMapCollection.cs
- SecurityElement.cs
- ApplicationCommands.cs
- HttpWebRequest.cs
- XsltFunctions.cs
- OneWayBindingElementImporter.cs
- DBDataPermission.cs
- ComponentCollection.cs
- MenuRenderer.cs
- GetRecipientRequest.cs
- XmlDocumentSerializer.cs
- DrawingContextDrawingContextWalker.cs
- IntAverageAggregationOperator.cs
- FieldMetadata.cs
- FileLevelControlBuilderAttribute.cs
- IgnoreSectionHandler.cs
- LinearGradientBrush.cs
- ButtonBase.cs
- CharacterBuffer.cs
- PointCollection.cs
- ToggleButton.cs
- AttributeData.cs
- SqlBulkCopyColumnMapping.cs
- DetailsViewRow.cs
- FixedSOMLineCollection.cs
- MarkupExtensionParser.cs
- sqlpipe.cs
- DataObject.cs
- ListSortDescription.cs
- MultiAsyncResult.cs
- Focus.cs
- OdbcEnvironmentHandle.cs
- ConfigXmlDocument.cs
- TextComposition.cs
- TrackingExtract.cs
- ValuePattern.cs
- GridViewRowCollection.cs
- KnownTypes.cs
- MessageRpc.cs
- CalendarDay.cs
- VideoDrawing.cs
- TextMarkerSource.cs
- WebPartZone.cs
- DurationConverter.cs
- WindowsStartMenu.cs