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
- SqlDependencyUtils.cs
- Parameter.cs
- QueryResponse.cs
- NativeMethods.cs
- ProviderSettingsCollection.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- GenericAuthenticationEventArgs.cs
- EditorPartCollection.cs
- VoiceInfo.cs
- DataIdProcessor.cs
- CSharpCodeProvider.cs
- ToolTipService.cs
- ExcludeFromCodeCoverageAttribute.cs
- DataGridTextBox.cs
- BatchParser.cs
- TextLineBreak.cs
- ArgumentNullException.cs
- DesignerDataConnection.cs
- WaitForChangedResult.cs
- RoutedEventHandlerInfo.cs
- XmlSignificantWhitespace.cs
- TextUtf8RawTextWriter.cs
- BreakRecordTable.cs
- StandardCommands.cs
- Dispatcher.cs
- GenericUriParser.cs
- _SslState.cs
- ObjectSecurity.cs
- InternalException.cs
- TableCellsCollectionEditor.cs
- SymmetricKey.cs
- ContentFileHelper.cs
- ScriptControlManager.cs
- XmlSchemaElement.cs
- CredentialCache.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- ToolStripDesignerAvailabilityAttribute.cs
- XhtmlBasicControlAdapter.cs
- RIPEMD160.cs
- SqlConnectionString.cs
- InputManager.cs
- XmlSchemaAll.cs
- TypeUnloadedException.cs
- PageStatePersister.cs
- SqlFacetAttribute.cs
- CollectionEditorDialog.cs
- ManagementClass.cs
- UserControlCodeDomTreeGenerator.cs
- Substitution.cs
- CommandDevice.cs
- ScriptingRoleServiceSection.cs
- MemberAccessException.cs
- FileAuthorizationModule.cs
- StreamWriter.cs
- WSDualHttpSecurityMode.cs
- AssociationSetMetadata.cs
- Translator.cs
- ProfessionalColorTable.cs
- Memoizer.cs
- StylusPointPropertyId.cs
- WinFormsUtils.cs
- QueryAccessibilityHelpEvent.cs
- Vertex.cs
- PolygonHotSpot.cs
- MediaPlayer.cs
- DataException.cs
- ExtendedPropertyCollection.cs
- GiveFeedbackEventArgs.cs
- Typography.cs
- BasicHttpSecurityElement.cs
- ResourceExpressionBuilder.cs
- XsltInput.cs
- ScrollChrome.cs
- StructuralObject.cs
- HttpDictionary.cs
- TypeAccessException.cs
- DocumentGridContextMenu.cs
- ImageMap.cs
- DataObjectCopyingEventArgs.cs
- SqlCacheDependencySection.cs
- DataGridViewAutoSizeModeEventArgs.cs
- XPathItem.cs
- EntityClassGenerator.cs
- ProcessHostConfigUtils.cs
- GetPageNumberCompletedEventArgs.cs
- CodeCompileUnit.cs
- BmpBitmapEncoder.cs
- ContextMarshalException.cs
- ResourceAssociationSetEnd.cs
- OutputCacheModule.cs
- DataTemplate.cs
- TextEditorCopyPaste.cs
- Validator.cs
- VisualTransition.cs
- OutputScopeManager.cs
- TabControl.cs
- JsonDeserializer.cs
- LeaseManager.cs
- XmlTextAttribute.cs
- NextPreviousPagerField.cs