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 / NameValueConfigurationElement.cs / 1 / NameValueConfigurationElement.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* ImmutableCollections
*
* Copyright (c) 2004 Microsoft Corporation
*/
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Net;
using System.Configuration;
//
// This file contains configuration collections that are used by multiple sections
//
namespace System.Configuration
{
public sealed class NameValueConfigurationElement : ConfigurationElement
{
private static ConfigurationPropertyCollection _properties;
private static readonly ConfigurationProperty _propName =
new ConfigurationProperty("name", typeof(string), String.Empty, ConfigurationPropertyOptions.IsKey);
private static readonly ConfigurationProperty _propValue =
new ConfigurationProperty("value", typeof(string), String.Empty, ConfigurationPropertyOptions.None);
static NameValueConfigurationElement()
{
// Property initialization
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propName);
_properties.Add(_propValue);
}
protected internal override ConfigurationPropertyCollection Properties
{
get
{
return _properties;
}
}
//
// Constructor
//
internal NameValueConfigurationElement()
{
}
public NameValueConfigurationElement(string name, string value)
{
base[_propName] = name;
base[_propValue] = value;
}
//
// Properties
//
//
// ConfigurationPropertyOptions.IsKey="true"
//
[ConfigurationProperty("name", IsKey = true, DefaultValue = "")]
public string Name
{
get
{
return (string)base[_propName];
}
}
[ConfigurationProperty("value", DefaultValue = "")]
public string Value
{
get
{
return (string)base[_propValue];
}
set
{
base[_propValue] = value;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
* ImmutableCollections
*
* Copyright (c) 2004 Microsoft Corporation
*/
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Net;
using System.Configuration;
//
// This file contains configuration collections that are used by multiple sections
//
namespace System.Configuration
{
public sealed class NameValueConfigurationElement : ConfigurationElement
{
private static ConfigurationPropertyCollection _properties;
private static readonly ConfigurationProperty _propName =
new ConfigurationProperty("name", typeof(string), String.Empty, ConfigurationPropertyOptions.IsKey);
private static readonly ConfigurationProperty _propValue =
new ConfigurationProperty("value", typeof(string), String.Empty, ConfigurationPropertyOptions.None);
static NameValueConfigurationElement()
{
// Property initialization
_properties = new ConfigurationPropertyCollection();
_properties.Add(_propName);
_properties.Add(_propValue);
}
protected internal override ConfigurationPropertyCollection Properties
{
get
{
return _properties;
}
}
//
// Constructor
//
internal NameValueConfigurationElement()
{
}
public NameValueConfigurationElement(string name, string value)
{
base[_propName] = name;
base[_propValue] = value;
}
//
// Properties
//
//
// ConfigurationPropertyOptions.IsKey="true"
//
[ConfigurationProperty("name", IsKey = true, DefaultValue = "")]
public string Name
{
get
{
return (string)base[_propName];
}
}
[ConfigurationProperty("value", DefaultValue = "")]
public string Value
{
get
{
return (string)base[_propValue];
}
set
{
base[_propValue] = value;
}
}
}
}
// 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
- WebPartDisplayModeCancelEventArgs.cs
- EntityConnectionStringBuilderItem.cs
- TraceHandlerErrorFormatter.cs
- RunWorkerCompletedEventArgs.cs
- AdornerLayer.cs
- FixedDocumentPaginator.cs
- LiteralSubsegment.cs
- WinFormsComponentEditor.cs
- XamlContextStack.cs
- TextStore.cs
- wgx_exports.cs
- XsltContext.cs
- CorrelationManager.cs
- ConfigsHelper.cs
- NativeMethodsOther.cs
- Blend.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- Claim.cs
- WebServicesInteroperability.cs
- Point3DCollectionConverter.cs
- PageOrientation.cs
- CipherData.cs
- XmlDocumentType.cs
- PartDesigner.cs
- BypassElementCollection.cs
- SpeechEvent.cs
- Drawing.cs
- JsonObjectDataContract.cs
- SecurityBindingElementImporter.cs
- RecoverInstanceLocksCommand.cs
- SkinBuilder.cs
- QilTargetType.cs
- CoTaskMemSafeHandle.cs
- ReceiveCompletedEventArgs.cs
- TimeSpanStorage.cs
- EncryptedType.cs
- IsolatedStorageException.cs
- ThumbAutomationPeer.cs
- FormViewDeletedEventArgs.cs
- ContextConfiguration.cs
- HostedAspNetEnvironment.cs
- StrokeNodeEnumerator.cs
- Executor.cs
- HttpResponseWrapper.cs
- ToolBarButton.cs
- OrthographicCamera.cs
- WebServiceData.cs
- SimplePropertyEntry.cs
- SiteMapNode.cs
- TabRenderer.cs
- ControlCollection.cs
- QilFunction.cs
- TableItemPattern.cs
- CallbackException.cs
- GridViewCellAutomationPeer.cs
- SigningDialog.cs
- MessageBox.cs
- TimeoutException.cs
- Missing.cs
- CookielessHelper.cs
- ObjectReferenceStack.cs
- WmlTextBoxAdapter.cs
- PasswordRecoveryAutoFormat.cs
- StylusDownEventArgs.cs
- DataKeyCollection.cs
- FilteredDataSetHelper.cs
- CreateRefExpr.cs
- DesignerImageAdapter.cs
- WsatExtendedInformation.cs
- TrustLevel.cs
- TrustLevel.cs
- DataGridSortingEventArgs.cs
- MachineSettingsSection.cs
- XsdBuilder.cs
- AsyncCompletedEventArgs.cs
- AssemblyNameProxy.cs
- listitem.cs
- Substitution.cs
- ObjectListGeneralPage.cs
- SplitterEvent.cs
- NamespaceDecl.cs
- BufferedGraphics.cs
- CompressEmulationStream.cs
- NameValueConfigurationCollection.cs
- GenericTextProperties.cs
- X509Certificate.cs
- XamlSerializerUtil.cs
- UIInitializationException.cs
- TriggerBase.cs
- ActivityPropertyReference.cs
- RSAOAEPKeyExchangeFormatter.cs
- ThumbAutomationPeer.cs
- QilCloneVisitor.cs
- BigInt.cs
- VisualStyleTypesAndProperties.cs
- ClientSettingsSection.cs
- LiteralControl.cs
- MetadataUtilsSmi.cs
- TouchesCapturedWithinProperty.cs
- MDIClient.cs