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
- Timeline.cs
- LicenseProviderAttribute.cs
- BuildProviderAppliesToAttribute.cs
- PagesSection.cs
- MatrixTransform.cs
- baseaxisquery.cs
- UnsettableComboBox.cs
- SqlTrackingService.cs
- SystemMulticastIPAddressInformation.cs
- metadatamappinghashervisitor.cs
- SourceChangedEventArgs.cs
- TypeConverterAttribute.cs
- MethodToken.cs
- SQLBytes.cs
- XsltLoader.cs
- NotFiniteNumberException.cs
- ModelServiceImpl.cs
- InputLanguageSource.cs
- Number.cs
- ActivityDesignerLayoutSerializers.cs
- UndoManager.cs
- DataTransferEventArgs.cs
- MemberCollection.cs
- TextStore.cs
- Light.cs
- RegistryPermission.cs
- ILGenerator.cs
- HttpContext.cs
- BaseParser.cs
- XmlSubtreeReader.cs
- XmlDataSource.cs
- HScrollProperties.cs
- Transform.cs
- BamlResourceDeserializer.cs
- InputMethod.cs
- Rotation3D.cs
- DataGridViewTextBoxEditingControl.cs
- Rotation3D.cs
- ViewRendering.cs
- NullableConverter.cs
- Perspective.cs
- TextRangeSerialization.cs
- CSharpCodeProvider.cs
- Rotation3DAnimationBase.cs
- PageParserFilter.cs
- PageParserFilter.cs
- PropertyConverter.cs
- HttpInputStream.cs
- LocalBuilder.cs
- PathSegmentCollection.cs
- IFormattable.cs
- XmlSchemaAppInfo.cs
- PtsHelper.cs
- TreeNodeSelectionProcessor.cs
- SymbolTable.cs
- Setter.cs
- ChooseAction.cs
- PointLight.cs
- DataControlFieldHeaderCell.cs
- Wizard.cs
- HandleRef.cs
- BigInt.cs
- RijndaelManaged.cs
- SoapAttributes.cs
- RelationshipDetailsRow.cs
- MappingModelBuildProvider.cs
- Decorator.cs
- HighlightComponent.cs
- SortedList.cs
- Localizer.cs
- storepermissionattribute.cs
- UserControlCodeDomTreeGenerator.cs
- _FtpControlStream.cs
- SystemIPGlobalStatistics.cs
- MouseActionValueSerializer.cs
- ReadOnlyPropertyMetadata.cs
- XmlSchemaSimpleContent.cs
- ResourceType.cs
- XamlToRtfWriter.cs
- BindStream.cs
- EventHandlerList.cs
- ComContractElement.cs
- ConnectionConsumerAttribute.cs
- CqlIdentifiers.cs
- ChtmlTextWriter.cs
- ToolStripPanelCell.cs
- DatasetMethodGenerator.cs
- SafeNativeMemoryHandle.cs
- AppLevelCompilationSectionCache.cs
- TableLayoutStyle.cs
- LinkedList.cs
- DataGridViewSelectedCellCollection.cs
- SecurityTokenParametersEnumerable.cs
- InternalConfigSettingsFactory.cs
- DBPropSet.cs
- OleDbParameter.cs
- basevalidator.cs
- Visitor.cs
- DataSourceProvider.cs
- Directory.cs