Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- Filter.cs
- MatrixStack.cs
- Typeface.cs
- PageHandlerFactory.cs
- Verify.cs
- TextElementCollection.cs
- OpCodes.cs
- EditorZoneBase.cs
- PackagePart.cs
- CorrelationToken.cs
- Enlistment.cs
- TextEditorContextMenu.cs
- RIPEMD160.cs
- WebControlToolBoxItem.cs
- SwitchAttribute.cs
- ZoneIdentityPermission.cs
- BaseComponentEditor.cs
- HttpPostedFile.cs
- ZipIOExtraFieldPaddingElement.cs
- TypeForwardedFromAttribute.cs
- SoapIgnoreAttribute.cs
- ScrollProperties.cs
- GreenMethods.cs
- TypeElement.cs
- SplitContainerDesigner.cs
- RegexGroup.cs
- VisualStyleInformation.cs
- FormsAuthenticationUser.cs
- GlyphInfoList.cs
- SqlRecordBuffer.cs
- Executor.cs
- MeasurementDCInfo.cs
- HelloMessageApril2005.cs
- SqlMethodTransformer.cs
- EdmSchemaError.cs
- TransportConfigurationTypeElementCollection.cs
- UpdateExpressionVisitor.cs
- InternalBase.cs
- LogoValidationException.cs
- SystemException.cs
- ComplexBindingPropertiesAttribute.cs
- WebContext.cs
- CounterSampleCalculator.cs
- DrawingServices.cs
- Math.cs
- DecoderBestFitFallback.cs
- XamlPointCollectionSerializer.cs
- CheckBox.cs
- WebMessageEncodingBindingElement.cs
- SmtpLoginAuthenticationModule.cs
- WorkflowCompensationBehavior.cs
- NullPackagingPolicy.cs
- JsonByteArrayDataContract.cs
- SynchronizedInputProviderWrapper.cs
- ListMarkerLine.cs
- XmlNamedNodeMap.cs
- CommonGetThemePartSize.cs
- InvalidOleVariantTypeException.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- NullableBoolConverter.cs
- Exception.cs
- CompilerErrorCollection.cs
- ButtonChrome.cs
- ProxyWebPart.cs
- XmlHelper.cs
- IIS7UserPrincipal.cs
- HyperLinkColumn.cs
- UnaryNode.cs
- HttpResponseInternalWrapper.cs
- RestHandlerFactory.cs
- PasswordBoxAutomationPeer.cs
- SchemaRegistration.cs
- XmlILStorageConverter.cs
- Package.cs
- PenContext.cs
- Stylus.cs
- Marshal.cs
- DoubleAnimationUsingPath.cs
- SharedStatics.cs
- IBuiltInEvidence.cs
- AnimationTimeline.cs
- ValidatorUtils.cs
- BuildProvider.cs
- QilInvokeLateBound.cs
- ReachUIElementCollectionSerializerAsync.cs
- PropertyRecord.cs
- ResourceContainer.cs
- RTTypeWrapper.cs
- WindowsAuthenticationModule.cs
- UserControlBuildProvider.cs
- TemplateInstanceAttribute.cs
- SecurityRuntime.cs
- XPathNavigatorKeyComparer.cs
- BooleanFunctions.cs
- LogLogRecordEnumerator.cs
- DynamicValidatorEventArgs.cs
- CommandBinding.cs
- ObjectViewListener.cs
- RawStylusSystemGestureInputReport.cs