Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / DefaultSection.cs / 1305376 / DefaultSection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System.Xml; public sealed class DefaultSection : ConfigurationSection { private static ConfigurationPropertyCollection s_properties; string _rawXml = string.Empty; bool _isModified; private static ConfigurationPropertyCollection EnsureStaticPropertyBag() { if (s_properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); s_properties = properties; } return s_properties; } public DefaultSection() { EnsureStaticPropertyBag(); } protected internal override ConfigurationPropertyCollection Properties { get { return EnsureStaticPropertyBag(); } } protected internal override bool IsModified() { return _isModified; } protected internal override void ResetModified() { _isModified = false; } protected internal override void Reset(ConfigurationElement parentSection) { _rawXml = string.Empty; _isModified = false; } protected internal override void DeserializeSection(XmlReader xmlReader) { if (!xmlReader.Read() || xmlReader.NodeType != XmlNodeType.Element) { throw new ConfigurationErrorsException(SR.GetString(SR.Config_base_expected_to_find_element), xmlReader); } _rawXml = xmlReader.ReadOuterXml(); _isModified = true; } protected internal override string SerializeSection(ConfigurationElement parentSection, string name, ConfigurationSaveMode saveMode) { return _rawXml; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System.Xml; public sealed class DefaultSection : ConfigurationSection { private static ConfigurationPropertyCollection s_properties; string _rawXml = string.Empty; bool _isModified; private static ConfigurationPropertyCollection EnsureStaticPropertyBag() { if (s_properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); s_properties = properties; } return s_properties; } public DefaultSection() { EnsureStaticPropertyBag(); } protected internal override ConfigurationPropertyCollection Properties { get { return EnsureStaticPropertyBag(); } } protected internal override bool IsModified() { return _isModified; } protected internal override void ResetModified() { _isModified = false; } protected internal override void Reset(ConfigurationElement parentSection) { _rawXml = string.Empty; _isModified = false; } protected internal override void DeserializeSection(XmlReader xmlReader) { if (!xmlReader.Read() || xmlReader.NodeType != XmlNodeType.Element) { throw new ConfigurationErrorsException(SR.GetString(SR.Config_base_expected_to_find_element), xmlReader); } _rawXml = xmlReader.ReadOuterXml(); _isModified = true; } protected internal override string SerializeSection(ConfigurationElement parentSection, string name, ConfigurationSaveMode saveMode) { return _rawXml; } } } // 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
- ObjectListCommandsPage.cs
- WebPartCancelEventArgs.cs
- ActivityExecutor.cs
- DockPatternIdentifiers.cs
- UIHelper.cs
- SettingsPropertyWrongTypeException.cs
- X509CertificateEndpointIdentity.cs
- SqlClientMetaDataCollectionNames.cs
- EntityDataSourceViewSchema.cs
- PageBuildProvider.cs
- WorkflowApplicationCompletedException.cs
- ImpersonateTokenRef.cs
- SectionInformation.cs
- StringFormat.cs
- RectAnimationUsingKeyFrames.cs
- SqlConnectionPoolProviderInfo.cs
- IssuedTokenClientCredential.cs
- ipaddressinformationcollection.cs
- GatewayDefinition.cs
- SspiNegotiationTokenAuthenticatorState.cs
- SystemInfo.cs
- SmiContext.cs
- xmlglyphRunInfo.cs
- ImageDesigner.cs
- HtmlSelect.cs
- Misc.cs
- BaseParser.cs
- TrustSection.cs
- HttpServerChannel.cs
- ImageMetadata.cs
- DocumentOutline.cs
- ImpersonateTokenRef.cs
- ResXResourceSet.cs
- XmlnsCache.cs
- LifetimeServices.cs
- ExtentKey.cs
- StrokeCollectionDefaultValueFactory.cs
- Geometry.cs
- ThreadSafeList.cs
- CodeMemberProperty.cs
- CodeMethodReturnStatement.cs
- XmlAttributeAttribute.cs
- TimeZone.cs
- PropertyBuilder.cs
- ListComponentEditorPage.cs
- FloatUtil.cs
- UnaryNode.cs
- ConnectionManagementElement.cs
- DSASignatureDeformatter.cs
- HtmlEmptyTagControlBuilder.cs
- DataGridViewAutoSizeModeEventArgs.cs
- SpeechAudioFormatInfo.cs
- ParserStreamGeometryContext.cs
- SelectedGridItemChangedEvent.cs
- DataBoundLiteralControl.cs
- DataGridLinkButton.cs
- HashLookup.cs
- AtomEntry.cs
- remotingproxy.cs
- CustomAttributeBuilder.cs
- DataGridViewColumnTypePicker.cs
- MobileListItem.cs
- CompoundFileIOPermission.cs
- InstanceValue.cs
- SpeechRecognizer.cs
- ProgressBarBrushConverter.cs
- SerializerWriterEventHandlers.cs
- JoinCqlBlock.cs
- PolicyValidator.cs
- SynchronizedInputPattern.cs
- Point3DKeyFrameCollection.cs
- FrameworkElement.cs
- RegionIterator.cs
- ControlBuilderAttribute.cs
- MachineKeyValidationConverter.cs
- WebConfigurationHost.cs
- DataGridClipboardHelper.cs
- OleStrCAMarshaler.cs
- WebSysDisplayNameAttribute.cs
- RegistrationServices.cs
- DragDropManager.cs
- WindowsSecurityToken.cs
- AnimatedTypeHelpers.cs
- DataGridColumnCollection.cs
- XpsS0ValidatingLoader.cs
- Point4DValueSerializer.cs
- PathSegment.cs
- XsltLibrary.cs
- OverflowException.cs
- ReferencedAssemblyResolver.cs
- RtfControls.cs
- Int32Storage.cs
- TypeSchema.cs
- ImageAnimator.cs
- HttpEncoder.cs
- SqlReferenceCollection.cs
- LinkArea.cs
- ToolStripLabel.cs
- TextDpi.cs
- TableLayoutStyleCollection.cs