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
- HttpGetServerProtocol.cs
- ConnectionManagementElementCollection.cs
- WebPartDisplayModeCancelEventArgs.cs
- ButtonField.cs
- RootBrowserWindowAutomationPeer.cs
- LabelEditEvent.cs
- XmlAnyElementAttribute.cs
- VirtualPath.cs
- RtType.cs
- RoleGroupCollection.cs
- StrongNameMembershipCondition.cs
- CallbackException.cs
- ExportOptions.cs
- ExplicitDiscriminatorMap.cs
- SiteMapNode.cs
- UiaCoreApi.cs
- IisTraceWebEventProvider.cs
- UTF32Encoding.cs
- EncryptedXml.cs
- TableSectionStyle.cs
- OdbcEnvironmentHandle.cs
- AnnotationMap.cs
- ResolveNameEventArgs.cs
- WaveHeader.cs
- TagMapCollection.cs
- RsaSecurityTokenAuthenticator.cs
- SchemaElementLookUpTable.cs
- DataServicePagingProviderWrapper.cs
- AvtEvent.cs
- SHA512.cs
- Int32.cs
- ClassGenerator.cs
- TypeUtil.cs
- WebServiceHandler.cs
- StringStorage.cs
- EDesignUtil.cs
- MDIControlStrip.cs
- WebPartTracker.cs
- ColorTransform.cs
- GridView.cs
- ExpressionPrefixAttribute.cs
- UnitySerializationHolder.cs
- Point3DCollectionValueSerializer.cs
- TemplateField.cs
- SafeSystemMetrics.cs
- CommandTreeTypeHelper.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- RubberbandSelector.cs
- ColumnWidthChangedEvent.cs
- DynamicPropertyHolder.cs
- ExternalFile.cs
- ProcessHostConfigUtils.cs
- FunctionNode.cs
- SharedStatics.cs
- SqlDataAdapter.cs
- ArrayList.cs
- ViewStateChangedEventArgs.cs
- ReachPrintTicketSerializerAsync.cs
- TextChange.cs
- SecurityPolicySection.cs
- Journal.cs
- Normalization.cs
- ExpressionConverter.cs
- Highlights.cs
- Exception.cs
- PropVariant.cs
- BitSet.cs
- TextServicesDisplayAttributePropertyRanges.cs
- CfgParser.cs
- SQLInt16Storage.cs
- WinFormsSecurity.cs
- OutOfProcStateClientManager.cs
- TextTreeText.cs
- CancellationTokenSource.cs
- SrgsSubset.cs
- Bits.cs
- ExpressionWriter.cs
- Win32Native.cs
- SoapParser.cs
- StringFreezingAttribute.cs
- RegisteredExpandoAttribute.cs
- DbParameterCollection.cs
- Math.cs
- SrgsElementList.cs
- KnownTypesHelper.cs
- HttpResponseInternalWrapper.cs
- QueryOperatorEnumerator.cs
- EncodingTable.cs
- FtpWebRequest.cs
- IResourceProvider.cs
- DynamicPropertyHolder.cs
- Util.cs
- AdPostCacheSubstitution.cs
- TypeUtils.cs
- TemplateControlBuildProvider.cs
- XmlSubtreeReader.cs
- CqlLexerHelpers.cs
- WebConfigurationManager.cs
- HiddenFieldPageStatePersister.cs
- Thickness.cs