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
- Container.cs
- TextServicesPropertyRanges.cs
- DoubleAnimationUsingPath.cs
- XmlWhitespace.cs
- BaseDataList.cs
- CqlQuery.cs
- DbConnectionPoolGroupProviderInfo.cs
- IdnElement.cs
- TypeSystemHelpers.cs
- LocalFileSettingsProvider.cs
- EntityDataSourceViewSchema.cs
- AgileSafeNativeMemoryHandle.cs
- Iis7Helper.cs
- CustomPopupPlacement.cs
- GridViewDeleteEventArgs.cs
- EndGetFileNameFromUserRequest.cs
- ProxyAttribute.cs
- GuidelineSet.cs
- HotCommands.cs
- ValidatingReaderNodeData.cs
- mansign.cs
- TrackBar.cs
- RedirectionProxy.cs
- SafeHandles.cs
- MediaCommands.cs
- XPathAncestorIterator.cs
- GridViewDeleteEventArgs.cs
- SplitterCancelEvent.cs
- XPathBuilder.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SortedDictionary.cs
- ErrorFormatterPage.cs
- WizardForm.cs
- SizeConverter.cs
- InstanceData.cs
- ListViewHitTestInfo.cs
- Metafile.cs
- AppLevelCompilationSectionCache.cs
- ToolStripArrowRenderEventArgs.cs
- ClrPerspective.cs
- DockPatternIdentifiers.cs
- TemplateBindingExtensionConverter.cs
- DataControlFieldCell.cs
- ProcessMessagesAsyncResult.cs
- ConnectionPointCookie.cs
- StreamInfo.cs
- StructuralCache.cs
- VisualStyleElement.cs
- ExtentJoinTreeNode.cs
- SetIndexBinder.cs
- XsdBuildProvider.cs
- ReversePositionQuery.cs
- ReadContentAsBinaryHelper.cs
- DataPagerFieldCommandEventArgs.cs
- WebServiceErrorEvent.cs
- GetReadStreamResult.cs
- ConfigUtil.cs
- OracleDataReader.cs
- ArraySubsetEnumerator.cs
- RawStylusInputCustomDataList.cs
- BitmapEffectDrawingContextWalker.cs
- ElementProxy.cs
- SessionStateSection.cs
- PreProcessor.cs
- M3DUtil.cs
- CreateUserErrorEventArgs.cs
- MultiPropertyDescriptorGridEntry.cs
- LocalValueEnumerator.cs
- DESCryptoServiceProvider.cs
- XmlNodeChangedEventManager.cs
- RemotingSurrogateSelector.cs
- MultiTouchSystemGestureLogic.cs
- InputMethodStateChangeEventArgs.cs
- InputLanguageEventArgs.cs
- UserControlAutomationPeer.cs
- SortedSetDebugView.cs
- XmlILModule.cs
- KeyEvent.cs
- LocatorBase.cs
- WCFServiceClientProxyGenerator.cs
- HttpCookie.cs
- PerspectiveCamera.cs
- HwndSourceParameters.cs
- CommandDevice.cs
- MdiWindowListStrip.cs
- DiscoveryDocumentSerializer.cs
- Funcletizer.cs
- TheQuery.cs
- ImageList.cs
- NTAccount.cs
- TrackingProfile.cs
- ActivitySurrogate.cs
- EntityStoreSchemaGenerator.cs
- LayoutEditorPart.cs
- XPathBinder.cs
- PhysicalFontFamily.cs
- SupportsEventValidationAttribute.cs
- WebPartPersonalization.cs
- MenuItemBinding.cs
- InternalSafeNativeMethods.cs