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
- MonitorWrapper.cs
- SubpageParaClient.cs
- SchemaNotation.cs
- BitmapEffectDrawingContextState.cs
- HandlerElementCollection.cs
- WebExceptionStatus.cs
- HyperLinkColumn.cs
- ApplicationContext.cs
- TraversalRequest.cs
- COMException.cs
- TextDecorationUnitValidation.cs
- TaskbarItemInfo.cs
- UIElementParaClient.cs
- SoapSchemaImporter.cs
- BitStream.cs
- WebPartZoneCollection.cs
- RootBuilder.cs
- HyperLinkStyle.cs
- AlphabetConverter.cs
- MimeWriter.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- RequestStatusBarUpdateEventArgs.cs
- TreeBuilderBamlTranslator.cs
- IdleTimeoutMonitor.cs
- RevocationPoint.cs
- XamlStream.cs
- DataControlFieldCollection.cs
- nulltextcontainer.cs
- XpsLiterals.cs
- MappingException.cs
- Scheduler.cs
- CompilerWrapper.cs
- XmlWriterTraceListener.cs
- MetadataCollection.cs
- BitmapEffectGroup.cs
- OperatorExpressions.cs
- ResourceAssociationType.cs
- MemberHolder.cs
- _UncName.cs
- GPRECT.cs
- ComponentCommands.cs
- ChannelDispatcherCollection.cs
- DbConnectionHelper.cs
- LeafCellTreeNode.cs
- ToolTipService.cs
- NativeCppClassAttribute.cs
- ExpressionBuilderCollection.cs
- DataGridViewRowStateChangedEventArgs.cs
- OverflowException.cs
- TypeSystem.cs
- CompilerCollection.cs
- PathData.cs
- XmlSchemaComplexType.cs
- _DigestClient.cs
- StoreAnnotationsMap.cs
- StateManagedCollection.cs
- EncodingDataItem.cs
- PbrsForward.cs
- DataSourceControl.cs
- MessageVersionConverter.cs
- StaticExtensionConverter.cs
- MimeMultiPart.cs
- ErrorWebPart.cs
- ClockController.cs
- UniqueIdentifierService.cs
- StateMachine.cs
- COM2PropertyDescriptor.cs
- DirectionalLight.cs
- UpdateCommandGenerator.cs
- DataSourceDescriptorCollection.cs
- EventMappingSettings.cs
- Crc32Helper.cs
- XmlNode.cs
- NumericExpr.cs
- RTLAwareMessageBox.cs
- ProjectionPlan.cs
- Bitmap.cs
- SqlUtil.cs
- WebReferencesBuildProvider.cs
- CustomTypeDescriptor.cs
- FaultHandlingFilter.cs
- CodeArgumentReferenceExpression.cs
- XPathDocument.cs
- BrowserCapabilitiesFactoryBase.cs
- CalendarItem.cs
- ComponentCommands.cs
- NotificationContext.cs
- ModuleConfigurationInfo.cs
- Icon.cs
- WebProxyScriptElement.cs
- ForeignKeyConstraint.cs
- XmlSchemaAnnotation.cs
- EventMap.cs
- OdbcConnectionString.cs
- SqlException.cs
- IChannel.cs
- PointConverter.cs
- ResourceExpressionBuilder.cs
- TemplateColumn.cs
- TreeNodeCollection.cs