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
- CompensateDesigner.cs
- HeaderCollection.cs
- Vector3DConverter.cs
- FrameworkReadOnlyPropertyMetadata.cs
- ToolStripDropDownItem.cs
- ExtendedTransformFactory.cs
- NavigationProgressEventArgs.cs
- TemplatedAdorner.cs
- ListView.cs
- DetailsViewUpdatedEventArgs.cs
- PositiveTimeSpanValidator.cs
- RoutedEventConverter.cs
- TableRowCollection.cs
- Perspective.cs
- RadioButtonPopupAdapter.cs
- DataPagerCommandEventArgs.cs
- AssemblyNameUtility.cs
- BinaryReader.cs
- LinqDataSourceHelper.cs
- FieldMetadata.cs
- HttpContext.cs
- ServicePerformanceCounters.cs
- EmptyStringExpandableObjectConverter.cs
- FeedUtils.cs
- OperandQuery.cs
- ValueConversionAttribute.cs
- AVElementHelper.cs
- PropertyGridEditorPart.cs
- OracleCommandSet.cs
- NonParentingControl.cs
- NamespaceList.cs
- ValidatorCollection.cs
- SpecularMaterial.cs
- AssociationType.cs
- HtmlWindow.cs
- EdgeProfileValidation.cs
- HtmlWindowCollection.cs
- RenderCapability.cs
- TextElementEditingBehaviorAttribute.cs
- Property.cs
- BaseDataList.cs
- Stylesheet.cs
- CleanUpVirtualizedItemEventArgs.cs
- AccessViolationException.cs
- DbConnectionPoolIdentity.cs
- FlowDocumentView.cs
- DocumentGridContextMenu.cs
- MgmtConfigurationRecord.cs
- TypeSource.cs
- FacetDescriptionElement.cs
- BorderGapMaskConverter.cs
- MinMaxParagraphWidth.cs
- XmlDocumentFragment.cs
- XmlArrayItemAttribute.cs
- DesignerHierarchicalDataSourceView.cs
- NativeActivity.cs
- TypeRefElement.cs
- Typeface.cs
- TextureBrush.cs
- XamlSerializer.cs
- DefaultSettingsSection.cs
- PrtCap_Public_Simple.cs
- Enumerable.cs
- NavigationPropertyEmitter.cs
- XPathNavigator.cs
- FaultPropagationRecord.cs
- NameTable.cs
- Attribute.cs
- EdmPropertyAttribute.cs
- ObjectCloneHelper.cs
- LinqDataSourceStatusEventArgs.cs
- CanonicalFormWriter.cs
- TableCellAutomationPeer.cs
- ProtectedConfigurationSection.cs
- LocalBuilder.cs
- SchemaContext.cs
- ToolboxDataAttribute.cs
- PrincipalPermission.cs
- Style.cs
- MimePart.cs
- Automation.cs
- ApplicationId.cs
- sqlmetadatafactory.cs
- OLEDB_Enum.cs
- DeleteIndexBinder.cs
- ContractListAdapter.cs
- CopyAttributesAction.cs
- WhileDesigner.cs
- PolicyStatement.cs
- ItemsControlAutomationPeer.cs
- ReadingWritingEntityEventArgs.cs
- Authorization.cs
- _AuthenticationState.cs
- EntityDataSourceViewSchema.cs
- WrapPanel.cs
- Int16Animation.cs
- DiscreteKeyFrames.cs
- DbConnectionPool.cs
- MarkupCompiler.cs
- SrgsGrammar.cs