Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- MediaEntryAttribute.cs
- DeleteMemberBinder.cs
- PropagatorResult.cs
- XmlSchemaGroup.cs
- LocalizabilityAttribute.cs
- DataObjectFieldAttribute.cs
- ThrowHelper.cs
- ColorTypeConverter.cs
- _ProxyRegBlob.cs
- SystemUdpStatistics.cs
- ToolStripSeparatorRenderEventArgs.cs
- Avt.cs
- StreamingContext.cs
- ServicesUtilities.cs
- Int16KeyFrameCollection.cs
- XmlExpressionDumper.cs
- ExceptionCollection.cs
- RecipientIdentity.cs
- printdlgexmarshaler.cs
- DbReferenceCollection.cs
- FixedSOMTableCell.cs
- ByteStreamMessageEncoder.cs
- HtmlInputFile.cs
- BinaryMethodMessage.cs
- ItemsPresenter.cs
- RubberbandSelector.cs
- SimpleRecyclingCache.cs
- DeploymentSection.cs
- WindowsFormsHelpers.cs
- SchemaImporterExtensionElement.cs
- EmptyStringExpandableObjectConverter.cs
- BindStream.cs
- ImageCreator.cs
- CapabilitiesSection.cs
- ModuleElement.cs
- ResourceDescriptionAttribute.cs
- NonVisualControlAttribute.cs
- HttpWriter.cs
- Scene3D.cs
- Int64AnimationBase.cs
- ParsedAttributeCollection.cs
- DesignerHelpers.cs
- MinMaxParagraphWidth.cs
- ProcessingInstructionAction.cs
- BasicHttpMessageCredentialType.cs
- TransformerInfoCollection.cs
- NavigationExpr.cs
- BaseComponentEditor.cs
- Vector3DConverter.cs
- SafeRegistryKey.cs
- ContentOnlyMessage.cs
- XmlnsCompatibleWithAttribute.cs
- FigureHelper.cs
- EntityDataSourceWrapper.cs
- Byte.cs
- IgnoreSectionHandler.cs
- PageHandlerFactory.cs
- PermissionAttributes.cs
- Floater.cs
- SchemaNames.cs
- ContextStack.cs
- EventProvider.cs
- AttributeParameterInfo.cs
- IndependentlyAnimatedPropertyMetadata.cs
- FileDialog.cs
- StorageBasedPackageProperties.cs
- SerializationUtilities.cs
- PipelineComponent.cs
- AlternateView.cs
- ScriptDescriptor.cs
- DecimalAnimationBase.cs
- BindToObject.cs
- Helper.cs
- MemoryRecordBuffer.cs
- UnauthorizedWebPart.cs
- CqlLexer.cs
- QilReplaceVisitor.cs
- TokenFactoryFactory.cs
- ValidationErrorCollection.cs
- CombinedGeometry.cs
- FixedDocument.cs
- ColorConverter.cs
- SqlHelper.cs
- DesignerAutoFormatStyle.cs
- SharedPerformanceCounter.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- WmpBitmapDecoder.cs
- SerialReceived.cs
- KeyConstraint.cs
- CheckBox.cs
- RoutedEventHandlerInfo.cs
- Margins.cs
- DataGridViewTextBoxColumn.cs
- Console.cs
- CompilationSection.cs
- BackgroundFormatInfo.cs
- XmlBinaryWriter.cs
- DataGridViewDataErrorEventArgs.cs
- AutoResetEvent.cs
- SoapDocumentMethodAttribute.cs