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 / DefaultSection.cs / 1 / 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
- ToolbarAUtomationPeer.cs
- SqlFormatter.cs
- LogReserveAndAppendState.cs
- TypeSystem.cs
- SamlSecurityTokenAuthenticator.cs
- HttpCachePolicyElement.cs
- TypographyProperties.cs
- RestHandlerFactory.cs
- XmlSchemaException.cs
- TickBar.cs
- CookieParameter.cs
- Misc.cs
- DocumentViewerBaseAutomationPeer.cs
- EntityDataSourceSelectedEventArgs.cs
- RequestResizeEvent.cs
- DataControlField.cs
- WeakReferenceList.cs
- KeyedCollection.cs
- CharAnimationUsingKeyFrames.cs
- XPathNodeHelper.cs
- HostingEnvironmentSection.cs
- MiniAssembly.cs
- DataBinder.cs
- TextPointer.cs
- SqlBulkCopy.cs
- SafeNativeMethodsCLR.cs
- PopOutPanel.cs
- RegisteredArrayDeclaration.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DateTimeValueSerializerContext.cs
- Operators.cs
- assertwrapper.cs
- FacetDescription.cs
- WebResponse.cs
- SecurityImpersonationBehavior.cs
- CodeGroup.cs
- TypeInformation.cs
- KeyProperty.cs
- LinkLabel.cs
- Speller.cs
- DictionaryBase.cs
- WebPartConnectionsCancelVerb.cs
- UpdateEventArgs.cs
- LinkedList.cs
- HttpCacheParams.cs
- PageCache.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- FlowDocument.cs
- BackgroundWorker.cs
- WebPartZoneBase.cs
- LinkDesigner.cs
- ItemsPresenter.cs
- UrlAuthFailedErrorFormatter.cs
- DesignerListAdapter.cs
- SignalGate.cs
- SettingsProviderCollection.cs
- WinEventWrap.cs
- ISAPIRuntime.cs
- ProcessModelSection.cs
- Serializer.cs
- EdmItemError.cs
- DesigntimeLicenseContext.cs
- StrokeNodeEnumerator.cs
- OdbcDataReader.cs
- SqlDataSourceView.cs
- __Error.cs
- InitializationEventAttribute.cs
- ComponentSerializationService.cs
- SiteMapNode.cs
- ISAPIApplicationHost.cs
- ListSortDescription.cs
- SelectedDatesCollection.cs
- ObservableCollection.cs
- tooltip.cs
- Debug.cs
- XPathMessageFilterElement.cs
- XmlSchemaInferenceException.cs
- RemotingConfigParser.cs
- SystemResources.cs
- ToolStripItem.cs
- ExpressionEditorSheet.cs
- DesignTimeHTMLTextWriter.cs
- SelectionWordBreaker.cs
- BrowserCapabilitiesFactory.cs
- FamilyTypeface.cs
- EncryptedKeyIdentifierClause.cs
- InstallHelper.cs
- InstanceLockLostException.cs
- UInt16Converter.cs
- PropertyTab.cs
- AddressHeaderCollection.cs
- Expressions.cs
- NCryptNative.cs
- EventLevel.cs
- ListItemParagraph.cs
- BlobPersonalizationState.cs
- SchemaImporterExtensionElementCollection.cs
- GridViewRowPresenter.cs
- PersistenceException.cs
- CodeMemberMethod.cs