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
- CryptoApi.cs
- ScrollItemPatternIdentifiers.cs
- InlineCollection.cs
- XmlSignatureProperties.cs
- WebScriptMetadataMessageEncodingBindingElement.cs
- CookieHandler.cs
- ServicesSection.cs
- QilPatternFactory.cs
- OrderedDictionary.cs
- MethodImplAttribute.cs
- BaseDataListComponentEditor.cs
- EntityDescriptor.cs
- NativeObjectSecurity.cs
- AnnotationComponentChooser.cs
- FlowLayoutPanel.cs
- ChtmlTextBoxAdapter.cs
- SafeNativeMethods.cs
- FastEncoderWindow.cs
- FormViewUpdatedEventArgs.cs
- ButtonColumn.cs
- StateMachine.cs
- UriParserTemplates.cs
- SqlRewriteScalarSubqueries.cs
- CompositeFontParser.cs
- TraceContextEventArgs.cs
- XslException.cs
- SettingsPropertyCollection.cs
- ReadOnlyObservableCollection.cs
- DataGridViewComboBoxColumnDesigner.cs
- SQLCharsStorage.cs
- XMLSyntaxException.cs
- OleCmdHelper.cs
- Connector.cs
- CompoundFileDeflateTransform.cs
- ImageSourceValueSerializer.cs
- RegionIterator.cs
- DataSpaceManager.cs
- JsonByteArrayDataContract.cs
- HelpProvider.cs
- TypeForwardedToAttribute.cs
- SQLDecimal.cs
- SimpleType.cs
- DataGridPagingPage.cs
- CapabilitiesPattern.cs
- ProcessThreadCollection.cs
- HttpListenerPrefixCollection.cs
- RecipientInfo.cs
- PointValueSerializer.cs
- ModelToObjectValueConverter.cs
- Line.cs
- TagPrefixAttribute.cs
- OletxCommittableTransaction.cs
- HotCommands.cs
- SerializerWriterEventHandlers.cs
- VolatileEnlistmentState.cs
- SoapSchemaExporter.cs
- TextParaClient.cs
- CryptoKeySecurity.cs
- PropertiesTab.cs
- ComUdtElement.cs
- ProfileProvider.cs
- InvokePattern.cs
- SoapTypeAttribute.cs
- FileAuthorizationModule.cs
- RuntimeHandles.cs
- WebBrowser.cs
- DependencyStoreSurrogate.cs
- UnsafeNativeMethods.cs
- ObjectReferenceStack.cs
- ContractInstanceProvider.cs
- ThreadStartException.cs
- DefaultProxySection.cs
- TraceUtils.cs
- AliasExpr.cs
- DebugTracing.cs
- MasterPageBuildProvider.cs
- HttpCacheParams.cs
- Imaging.cs
- Ops.cs
- MissingSatelliteAssemblyException.cs
- ActiveDesignSurfaceEvent.cs
- NameValuePermission.cs
- ProcessModule.cs
- SecurityKeyIdentifier.cs
- SchemaTableOptionalColumn.cs
- BinaryParser.cs
- FlowStep.cs
- CommonXSendMessage.cs
- ValidationService.cs
- ContractNamespaceAttribute.cs
- DateTimeOffsetAdapter.cs
- NavigationEventArgs.cs
- CellParaClient.cs
- ProviderSettings.cs
- LogicalTreeHelper.cs
- DummyDataSource.cs
- TextEditorLists.cs
- ToggleButton.cs
- DataSourceSelectArguments.cs
- ReadWriteObjectLock.cs