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
- ScriptRegistrationManager.cs
- DropShadowEffect.cs
- XPathParser.cs
- StringHelper.cs
- QueryableDataSourceView.cs
- DispatcherOperation.cs
- ClientEventManager.cs
- BamlMapTable.cs
- TypeReference.cs
- InputBindingCollection.cs
- GorillaCodec.cs
- UpWmlPageAdapter.cs
- CommandHelper.cs
- BinaryCommonClasses.cs
- WriteFileContext.cs
- MobileControlsSectionHelper.cs
- ControlBuilderAttribute.cs
- AttachedAnnotation.cs
- SectionRecord.cs
- Graphics.cs
- XmlValueConverter.cs
- IList.cs
- ContainerControl.cs
- MobileUserControl.cs
- Partitioner.cs
- TypeUtils.cs
- SymLanguageType.cs
- XmlSubtreeReader.cs
- FixedSOMSemanticBox.cs
- Hashtable.cs
- ToolboxItemCollection.cs
- InkCanvasAutomationPeer.cs
- ListViewEditEventArgs.cs
- Vector3DCollection.cs
- ProgressiveCrcCalculatingStream.cs
- SolidBrush.cs
- ListenerElementsCollection.cs
- TypedTableBaseExtensions.cs
- InfoCardTrace.cs
- SqlTriggerAttribute.cs
- dataobject.cs
- SQLBytes.cs
- TrustManager.cs
- CubicEase.cs
- DocumentGrid.cs
- XmlQualifiedNameTest.cs
- StylusCollection.cs
- DbResourceAllocator.cs
- DynamicPropertyReader.cs
- OrderedEnumerableRowCollection.cs
- EntityDataSourceUtil.cs
- XmlSchemaAttributeGroupRef.cs
- StaticFileHandler.cs
- HttpRuntimeSection.cs
- DocumentAutomationPeer.cs
- SqlUdtInfo.cs
- DrawingGroupDrawingContext.cs
- ExpressionBinding.cs
- HttpValueCollection.cs
- ClientApiGenerator.cs
- WorkflowCompensationBehavior.cs
- StringAttributeCollection.cs
- ReferenceSchema.cs
- TrustLevelCollection.cs
- RootBrowserWindowAutomationPeer.cs
- RubberbandSelector.cs
- ControlSerializer.cs
- MenuRenderer.cs
- PasswordTextContainer.cs
- XamlPointCollectionSerializer.cs
- LayoutEditorPart.cs
- ThrowHelper.cs
- BitmapInitialize.cs
- FileSecurity.cs
- DropSourceBehavior.cs
- TiffBitmapEncoder.cs
- UserControlCodeDomTreeGenerator.cs
- TraceListeners.cs
- ReversePositionQuery.cs
- PropertyRef.cs
- ValidationEventArgs.cs
- ExpressionConverter.cs
- HtmlToClrEventProxy.cs
- Int32RectConverter.cs
- GetPageNumberCompletedEventArgs.cs
- XmlDigitalSignatureProcessor.cs
- SystemParameters.cs
- SqlParameterCollection.cs
- ByteAnimationBase.cs
- SafeThemeHandle.cs
- XmlUTF8TextWriter.cs
- SqlDataSourceCache.cs
- SqlClientMetaDataCollectionNames.cs
- VolatileEnlistmentMultiplexing.cs
- DocumentManager.cs
- CodeCatchClauseCollection.cs
- DynamicRendererThreadManager.cs
- ContentFileHelper.cs
- QueryContinueDragEvent.cs
- HtmlContainerControl.cs