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
- WsatTransactionHeader.cs
- RouteParser.cs
- Pkcs7Recipient.cs
- Console.cs
- SynchronizingStream.cs
- FillBehavior.cs
- FileStream.cs
- LinkedResourceCollection.cs
- ClientBuildManager.cs
- Accessors.cs
- ModifyActivitiesPropertyDescriptor.cs
- MimeTypeAttribute.cs
- InternalRelationshipCollection.cs
- BitmapCacheBrush.cs
- Decimal.cs
- GridViewDeletedEventArgs.cs
- LinqDataView.cs
- DrawingCollection.cs
- GroupDescription.cs
- Comparer.cs
- RegexTree.cs
- BaseHashHelper.cs
- DependencyPropertyChangedEventArgs.cs
- EntityDataSourceConfigureObjectContext.cs
- BinaryCommonClasses.cs
- PrivateFontCollection.cs
- SQLInt32Storage.cs
- GeneralTransform.cs
- SecondaryIndexDefinition.cs
- KeyToListMap.cs
- XmlBinaryWriter.cs
- SafeCryptoHandles.cs
- ColorMap.cs
- ErrorFormatterPage.cs
- RuntimeResourceSet.cs
- HtmlInputButton.cs
- ControlOperationInvoker.cs
- WindowCollection.cs
- ExpressionBindings.cs
- PublisherIdentityPermission.cs
- PaintEvent.cs
- Code.cs
- CustomSignedXml.cs
- DetailsViewPagerRow.cs
- RepeaterItem.cs
- PropertyGridCommands.cs
- ProxyWebPartConnectionCollection.cs
- RadioButton.cs
- XhtmlBasicSelectionListAdapter.cs
- _NestedSingleAsyncResult.cs
- NumberFormatInfo.cs
- ApplicationFileCodeDomTreeGenerator.cs
- SqlFunctions.cs
- BaseCollection.cs
- XmlSchemaAnnotated.cs
- Nodes.cs
- EventRoute.cs
- WebPartEditVerb.cs
- SystemException.cs
- TableLayoutStyleCollection.cs
- VectorValueSerializer.cs
- SchemaTypeEmitter.cs
- SQLBytesStorage.cs
- CapacityStreamGeometryContext.cs
- SuppressMessageAttribute.cs
- StylusPointPropertyInfoDefaults.cs
- WizardSideBarListControlItem.cs
- MimeMapping.cs
- PerformanceCounterPermission.cs
- SignatureResourcePool.cs
- SqlDependencyListener.cs
- XmlSchemaAnyAttribute.cs
- ShaderEffect.cs
- Errors.cs
- PreProcessor.cs
- mactripleDES.cs
- ISSmlParser.cs
- AuthorizationSection.cs
- DesignerLabelAdapter.cs
- RedBlackList.cs
- XmlNamespaceDeclarationsAttribute.cs
- OleDbPropertySetGuid.cs
- Gdiplus.cs
- DateTimeOffsetAdapter.cs
- Tokenizer.cs
- NameSpaceExtractor.cs
- _Win32.cs
- UrlMappingsSection.cs
- EventToken.cs
- ViewBox.cs
- ReadOnlyPropertyMetadata.cs
- PasswordTextNavigator.cs
- BidOverLoads.cs
- CodeIdentifier.cs
- TextEndOfSegment.cs
- OdbcTransaction.cs
- LinqDataSourceView.cs
- GeneralTransform3D.cs
- XpsS0ValidatingLoader.cs
- UrlPath.cs