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
- HuffCodec.cs
- ProtectedConfigurationProviderCollection.cs
- LinqDataView.cs
- Int32Storage.cs
- precedingsibling.cs
- InternalDispatchObject.cs
- Axis.cs
- ToolStripDropDownClosingEventArgs.cs
- StoragePropertyMapping.cs
- InputMethodStateTypeInfo.cs
- SiteMapProvider.cs
- RuntimeArgumentHandle.cs
- Statements.cs
- AttributeInfo.cs
- EntityViewContainer.cs
- Point.cs
- CaseInsensitiveHashCodeProvider.cs
- TreeNodeCollection.cs
- UpDownBase.cs
- SQLBytes.cs
- ConfigurationSettings.cs
- DependencyObjectValidator.cs
- AnimationStorage.cs
- ReaderWriterLockWrapper.cs
- UserInitiatedRoutedEventPermissionAttribute.cs
- JavaScriptSerializer.cs
- Rotation3DAnimation.cs
- QilScopedVisitor.cs
- smtppermission.cs
- COM2Properties.cs
- Point4D.cs
- BeginGetFileNameFromUserRequest.cs
- XNameConverter.cs
- RijndaelManaged.cs
- FontUnit.cs
- Size3DConverter.cs
- VScrollBar.cs
- FlowDocumentReaderAutomationPeer.cs
- HttpServerUtilityWrapper.cs
- WMIGenerator.cs
- ClientConfigPaths.cs
- BindingExpressionBase.cs
- SqlConnection.cs
- WriteableOnDemandPackagePart.cs
- SyndicationDeserializer.cs
- Operators.cs
- ConfigurationPermission.cs
- OleDragDropHandler.cs
- LogWriteRestartAreaAsyncResult.cs
- BitmapEffectGroup.cs
- ClipboardData.cs
- PipelineModuleStepContainer.cs
- Bezier.cs
- ObjectDataSourceStatusEventArgs.cs
- SymmetricAlgorithm.cs
- Collection.cs
- XPathNode.cs
- MethodExpr.cs
- UIPermission.cs
- storepermissionattribute.cs
- BinaryVersion.cs
- ConnectionsZone.cs
- WebPartZoneBase.cs
- CompModSwitches.cs
- WindowsAuthenticationEventArgs.cs
- WebReferencesBuildProvider.cs
- DrawingImage.cs
- PngBitmapDecoder.cs
- Size3D.cs
- QueryCacheManager.cs
- Rules.cs
- SqlCommandAsyncResult.cs
- ListSurrogate.cs
- DeviceSpecific.cs
- ChangePassword.cs
- ArrangedElement.cs
- LinqDataSourceStatusEventArgs.cs
- CheckBox.cs
- XAMLParseException.cs
- ConfigurationPermission.cs
- MarshalDirectiveException.cs
- WCFBuildProvider.cs
- VarRefManager.cs
- StickyNote.cs
- ObjectStateEntry.cs
- State.cs
- ConnectionInterfaceCollection.cs
- ClassicBorderDecorator.cs
- ServiceDescriptions.cs
- DefaultAssemblyResolver.cs
- TypeBuilder.cs
- mansign.cs
- SettingsProviderCollection.cs
- SqlDataAdapter.cs
- SoapUnknownHeader.cs
- WebOperationContext.cs
- Rotation3DAnimationBase.cs
- Variable.cs
- DiscardableAttribute.cs
- ViewCellSlot.cs