Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / NameValueConfigurationElement.cs / 1305376 / 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
- OdbcCommand.cs
- RouteValueDictionary.cs
- LOSFormatter.cs
- ConfigurationPropertyAttribute.cs
- WebBrowserNavigatedEventHandler.cs
- LinqDataSourceContextEventArgs.cs
- SqlXmlStorage.cs
- TextControlDesigner.cs
- TextMessageEncodingElement.cs
- RandomNumberGenerator.cs
- ExpressionConverter.cs
- XamlTreeBuilder.cs
- NonPrimarySelectionGlyph.cs
- CountAggregationOperator.cs
- InvariantComparer.cs
- mediaeventshelper.cs
- ConfigDefinitionUpdates.cs
- Baml2006Reader.cs
- WinEventQueueItem.cs
- ClientSettingsStore.cs
- ActivationProxy.cs
- CharConverter.cs
- IDictionary.cs
- JsonObjectDataContract.cs
- HealthMonitoringSection.cs
- DSASignatureFormatter.cs
- Point3DCollectionConverter.cs
- DataViewSettingCollection.cs
- TextFormatter.cs
- SafeRightsManagementPubHandle.cs
- WindowsFormsSynchronizationContext.cs
- RSAPKCS1KeyExchangeFormatter.cs
- PropertyChangedEventArgs.cs
- QilInvokeLateBound.cs
- AssertFilter.cs
- HexParser.cs
- ToolStripSeparatorRenderEventArgs.cs
- SiteMapDataSource.cs
- WpfMemberInvoker.cs
- Animatable.cs
- CombinedGeometry.cs
- DesignerActionPanel.cs
- Button.cs
- CommandSet.cs
- PerformanceCounterPermission.cs
- SoapProtocolReflector.cs
- ListBindingHelper.cs
- HttpServerVarsCollection.cs
- SplashScreen.cs
- SafePEFileHandle.cs
- securitycriticaldata.cs
- TextStore.cs
- WebControlAdapter.cs
- DbParameterHelper.cs
- DocumentPageTextView.cs
- EventDescriptor.cs
- ObjectItemConventionAssemblyLoader.cs
- XmlBinaryReaderSession.cs
- Label.cs
- streamingZipPartStream.cs
- DeleteWorkflowOwnerCommand.cs
- FontCollection.cs
- ModuleBuilderData.cs
- SplayTreeNode.cs
- MultiAsyncResult.cs
- MultiSelector.cs
- XPathDocumentIterator.cs
- ConnectionPointCookie.cs
- OrderedDictionary.cs
- WindowsStatic.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- TreeViewHitTestInfo.cs
- UrlPath.cs
- WSSecurityPolicy.cs
- SoapReflector.cs
- ReadOnlyDataSourceView.cs
- ColorConverter.cs
- StateWorkerRequest.cs
- BasicViewGenerator.cs
- SoapSchemaMember.cs
- PowerModeChangedEventArgs.cs
- DataObjectCopyingEventArgs.cs
- ComboBoxAutomationPeer.cs
- TreeViewAutomationPeer.cs
- CodeDirectoryCompiler.cs
- XmlElementList.cs
- OperationAbortedException.cs
- KeyGestureConverter.cs
- DrawingAttributes.cs
- FileDialog_Vista_Interop.cs
- FixedSOMSemanticBox.cs
- SqlCommandAsyncResult.cs
- DocumentPageViewAutomationPeer.cs
- LassoHelper.cs
- HttpModuleActionCollection.cs
- DbConnectionPoolCounters.cs
- ArcSegment.cs
- SpeechEvent.cs
- SqlCacheDependencySection.cs
- GridViewRowPresenterBase.cs