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
- UIntPtr.cs
- PostBackOptions.cs
- StringComparer.cs
- GridProviderWrapper.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- X509DefaultServiceCertificateElement.cs
- CodeTypeParameterCollection.cs
- PlanCompiler.cs
- MetadataUtil.cs
- WizardForm.cs
- CapabilitiesAssignment.cs
- BadImageFormatException.cs
- CommandExpr.cs
- PeerNodeTraceRecord.cs
- MonthCalendar.cs
- ResolvedKeyFrameEntry.cs
- WizardPanelChangingEventArgs.cs
- GridViewColumnCollection.cs
- TextSpan.cs
- DCSafeHandle.cs
- XamlWriter.cs
- SoapExtensionImporter.cs
- ConfigurationPropertyCollection.cs
- Rect.cs
- CachedFontFace.cs
- RectConverter.cs
- SerializerProvider.cs
- Token.cs
- HtmlShim.cs
- RegexMatchCollection.cs
- HyperLink.cs
- ConfigXmlElement.cs
- SspiSafeHandles.cs
- TranslateTransform.cs
- StorageEntityTypeMapping.cs
- DefaultTextStore.cs
- XmlDataCollection.cs
- HttpCookieCollection.cs
- EventMappingSettings.cs
- SectionRecord.cs
- IsolatedStorageFilePermission.cs
- WhitespaceRule.cs
- PeerPresenceInfo.cs
- FileNotFoundException.cs
- SystemNetHelpers.cs
- HitTestParameters.cs
- WorkflowOwnerAsyncResult.cs
- CustomWebEventKey.cs
- TextInfo.cs
- TextEditorLists.cs
- ComboBoxItem.cs
- CodeTypeReferenceCollection.cs
- ComAdminWrapper.cs
- BaseDataListDesigner.cs
- OdbcCommand.cs
- CacheMemory.cs
- TableRowCollection.cs
- LingerOption.cs
- StringUtil.cs
- BindingListCollectionView.cs
- VersionedStreamOwner.cs
- Rect3DConverter.cs
- UnsafeNativeMethods.cs
- Canvas.cs
- CuspData.cs
- UnsafeNativeMethodsMilCoreApi.cs
- DrawingGroup.cs
- OutOfProcStateClientManager.cs
- Internal.cs
- DataBoundControl.cs
- WindowsAuthenticationModule.cs
- DbMetaDataCollectionNames.cs
- RootProfilePropertySettingsCollection.cs
- ArrayHelper.cs
- AvTraceFormat.cs
- EntityDataSourceChangedEventArgs.cs
- ValidatedControlConverter.cs
- ReadOnlyDataSourceView.cs
- MissingSatelliteAssemblyException.cs
- BitmapEffect.cs
- XmlNamespaceDeclarationsAttribute.cs
- GridViewColumn.cs
- Control.cs
- TransformCryptoHandle.cs
- Point3DAnimation.cs
- AutomationElementIdentifiers.cs
- UrlMappingsSection.cs
- XmlElement.cs
- TerminatorSinks.cs
- SchemaNames.cs
- Triangle.cs
- FixedFlowMap.cs
- IisTraceListener.cs
- StateChangeEvent.cs
- ListViewGroupConverter.cs
- ComboBoxAutomationPeer.cs
- Single.cs
- WindowsGrip.cs
- OracleConnectionFactory.cs
- OleDbRowUpdatingEvent.cs