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
- FilteredDataSetHelper.cs
- SchemaTableColumn.cs
- NotImplementedException.cs
- SQLChars.cs
- UriExt.cs
- LineSegment.cs
- ClonableStack.cs
- SoapAttributes.cs
- SendReply.cs
- HtmlTableRowCollection.cs
- HostingMessageProperty.cs
- TrimSurroundingWhitespaceAttribute.cs
- ToolStripItemRenderEventArgs.cs
- TargetConverter.cs
- SystemColorTracker.cs
- PropertyMapper.cs
- CallbackHandler.cs
- FormParameter.cs
- PkcsUtils.cs
- WebPartEventArgs.cs
- NamespaceCollection.cs
- TextFindEngine.cs
- ContainerVisual.cs
- Application.cs
- Animatable.cs
- DashStyles.cs
- BordersPage.cs
- OdbcErrorCollection.cs
- WindowsServiceCredential.cs
- StateMachineSubscriptionManager.cs
- InheritedPropertyDescriptor.cs
- SqlFormatter.cs
- Attributes.cs
- UnmanagedMemoryStream.cs
- CalendarDesigner.cs
- EntityDescriptor.cs
- ToolStripPanelCell.cs
- CompilerHelpers.cs
- StrokeNode.cs
- ArgumentNullException.cs
- SoapSchemaMember.cs
- XhtmlConformanceSection.cs
- EventOpcode.cs
- TailPinnedEventArgs.cs
- EventBindingService.cs
- HttpRawResponse.cs
- Message.cs
- InputLangChangeEvent.cs
- AppDomainUnloadedException.cs
- AddingNewEventArgs.cs
- ResourceManager.cs
- UInt64Storage.cs
- NativeMethodsCLR.cs
- EventHandlersStore.cs
- NavigatorOutput.cs
- StylusCaptureWithinProperty.cs
- Underline.cs
- EnumConverter.cs
- ApplyTemplatesAction.cs
- XmlSchemaComplexType.cs
- figurelength.cs
- Span.cs
- DesignerDataConnection.cs
- QueryReaderSettings.cs
- TextProperties.cs
- HMAC.cs
- Int32RectConverter.cs
- SourceFileInfo.cs
- ClosableStream.cs
- KoreanCalendar.cs
- RolePrincipal.cs
- DesignerAutoFormatCollection.cs
- GroupDescription.cs
- ControlUtil.cs
- MsmqIntegrationSecurity.cs
- WinInetCache.cs
- NumberFormatInfo.cs
- MarkupCompilePass1.cs
- SchemaType.cs
- BindingOperations.cs
- DynamicMethod.cs
- PipelineModuleStepContainer.cs
- DBAsyncResult.cs
- OleDbDataAdapter.cs
- CircleEase.cs
- ProcessRequestArgs.cs
- ValidationEventArgs.cs
- M3DUtil.cs
- KeyValueConfigurationCollection.cs
- AbstractExpressions.cs
- HtmlInputButton.cs
- GlyphRun.cs
- PTManager.cs
- GifBitmapDecoder.cs
- CurrentTimeZone.cs
- UndoManager.cs
- UnwrappedTypesXmlSerializerManager.cs
- Nodes.cs
- Unit.cs
- Point3DAnimationBase.cs