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
- ColumnPropertiesGroup.cs
- InnerItemCollectionView.cs
- assemblycache.cs
- GeneralTransformGroup.cs
- Delegate.cs
- DefaultEventAttribute.cs
- KerberosTicketHashIdentifierClause.cs
- XmlSchemaDocumentation.cs
- ChannelManager.cs
- PipeException.cs
- EmptyEnumerable.cs
- ResXResourceSet.cs
- OleDbReferenceCollection.cs
- LabelLiteral.cs
- PersonalizationProvider.cs
- RectangleConverter.cs
- ArrayHelper.cs
- DataServiceHostWrapper.cs
- DelegatedStream.cs
- RuleElement.cs
- BitmapPalette.cs
- ManipulationDevice.cs
- XmlSchemaValidationException.cs
- Hyperlink.cs
- datacache.cs
- DetailsViewPageEventArgs.cs
- XmlAttributes.cs
- ComplexBindingPropertiesAttribute.cs
- GlyphShapingProperties.cs
- OpenFileDialog.cs
- TextEditorSelection.cs
- Storyboard.cs
- storepermission.cs
- DataGridViewColumnEventArgs.cs
- EditorZoneDesigner.cs
- DynamicRendererThreadManager.cs
- TraceContext.cs
- versioninfo.cs
- SystemIcons.cs
- IERequestCache.cs
- NewArrayExpression.cs
- LongMinMaxAggregationOperator.cs
- InstrumentationTracker.cs
- CallbackDebugElement.cs
- LateBoundBitmapDecoder.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- WindowsTooltip.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- PolyBezierSegmentFigureLogic.cs
- ListViewGroupItemCollection.cs
- ComboBoxRenderer.cs
- FormViewInsertEventArgs.cs
- AsyncResult.cs
- NativeDirectoryServicesQueryAPIs.cs
- ConfigurationManager.cs
- DetailsView.cs
- AudioFormatConverter.cs
- FeatureAttribute.cs
- CompilationLock.cs
- AppendHelper.cs
- ObjRef.cs
- PeerObject.cs
- SuppressMergeCheckAttribute.cs
- StdValidatorsAndConverters.cs
- TraversalRequest.cs
- ControlCommandSet.cs
- ModuleConfigurationInfo.cs
- EntityDataSourceConfigureObjectContextPanel.cs
- AuthorizationSection.cs
- FileInfo.cs
- RolePrincipal.cs
- HighContrastHelper.cs
- DataContext.cs
- QueryContinueDragEvent.cs
- CommandValueSerializer.cs
- ProbeMatchesApril2005.cs
- NegotiateStream.cs
- TableRowCollection.cs
- TcpTransportBindingElement.cs
- DisplayNameAttribute.cs
- DriveNotFoundException.cs
- SqlParameterizer.cs
- UnsafeNativeMethodsPenimc.cs
- XhtmlTextWriter.cs
- RulePatternOps.cs
- securitycriticaldataformultiplegetandset.cs
- SafeSystemMetrics.cs
- TraversalRequest.cs
- Int16AnimationBase.cs
- ProgressBarAutomationPeer.cs
- HebrewNumber.cs
- MembershipValidatePasswordEventArgs.cs
- TransportBindingElement.cs
- FlowDocumentReaderAutomationPeer.cs
- Matrix.cs
- invalidudtexception.cs
- WizardPanelChangingEventArgs.cs
- HuffModule.cs
- Storyboard.cs
- ObjectManager.cs