Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- NoPersistProperty.cs
- UpdatePanel.cs
- WebPartAuthorizationEventArgs.cs
- MetadataArtifactLoaderComposite.cs
- mediaeventargs.cs
- WindowsRebar.cs
- StdValidatorsAndConverters.cs
- FormsAuthenticationTicket.cs
- WebPartHeaderCloseVerb.cs
- StructuredType.cs
- xamlnodes.cs
- InstanceDescriptor.cs
- OpCellTreeNode.cs
- JumpItem.cs
- VersionedStream.cs
- selecteditemcollection.cs
- SerialPinChanges.cs
- DataSvcMapFileSerializer.cs
- TdsParser.cs
- AtomContentProperty.cs
- PrintDialog.cs
- HtmlPanelAdapter.cs
- HttpCacheVaryByContentEncodings.cs
- ProviderSettings.cs
- VolatileEnlistmentMultiplexing.cs
- RenderDataDrawingContext.cs
- DropShadowEffect.cs
- SharedHttpTransportManager.cs
- SourceSwitch.cs
- AssociationProvider.cs
- NativeConfigurationLoader.cs
- ResourceProviderFactory.cs
- WindowInteropHelper.cs
- SkewTransform.cs
- XmlNamespaceMappingCollection.cs
- NumberFunctions.cs
- XamlPathDataSerializer.cs
- EventListenerClientSide.cs
- SequentialOutput.cs
- FileSecurity.cs
- XmlFormatExtensionPrefixAttribute.cs
- LinkedResourceCollection.cs
- Input.cs
- ReadOnlyMetadataCollection.cs
- SqlMetaData.cs
- DBSchemaTable.cs
- WinFormsSpinner.cs
- TypeConstant.cs
- CopyCodeAction.cs
- SqlClientFactory.cs
- ClockController.cs
- StreamAsIStream.cs
- RoleManagerSection.cs
- StateManagedCollection.cs
- UrlAuthorizationModule.cs
- TabPanel.cs
- InkCanvas.cs
- RuntimeUtils.cs
- LingerOption.cs
- SerializationObjectManager.cs
- HtmlAnchor.cs
- DataGridViewButtonColumn.cs
- SemanticTag.cs
- TableCell.cs
- MonthCalendar.cs
- HttpProfileGroupBase.cs
- CellQuery.cs
- TargetException.cs
- SchemaTableColumn.cs
- PropertyContainer.cs
- GeneralTransform3D.cs
- ObjectSecurity.cs
- MLangCodePageEncoding.cs
- PeerTransportSecurityElement.cs
- Scripts.cs
- PeerNameRegistration.cs
- DrawingBrush.cs
- MLangCodePageEncoding.cs
- MultiView.cs
- XamlLoadErrorInfo.cs
- EmbeddedObject.cs
- ReadOnlyDictionary.cs
- SchemaType.cs
- HideDisabledControlAdapter.cs
- ColumnReorderedEventArgs.cs
- path.cs
- ProviderConnectionPointCollection.cs
- Win32SafeHandles.cs
- HttpCookiesSection.cs
- SharedStatics.cs
- ContainerParaClient.cs
- EventSetterHandlerConverter.cs
- ZeroOpNode.cs
- DynamicObject.cs
- ViewEvent.cs
- XmlQueryStaticData.cs
- InstanceNotReadyException.cs
- SlotInfo.cs
- ExpressionHelper.cs
- CategoryEditor.cs