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
- SoapFault.cs
- Part.cs
- SqlBulkCopyColumnMapping.cs
- RadioButtonPopupAdapter.cs
- DocumentGridContextMenu.cs
- WorkflowApplicationUnloadedException.cs
- TextRangeBase.cs
- RowUpdatingEventArgs.cs
- Soap.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- Keyboard.cs
- PassportAuthenticationEventArgs.cs
- FeatureSupport.cs
- DisplayInformation.cs
- Interlocked.cs
- GPPOINT.cs
- DefaultBindingPropertyAttribute.cs
- EntityDataSourceChangedEventArgs.cs
- DecimalAnimationUsingKeyFrames.cs
- SessionStateUtil.cs
- ChangeInterceptorAttribute.cs
- JsonQNameDataContract.cs
- DataTableClearEvent.cs
- InternalPolicyElement.cs
- errorpatternmatcher.cs
- AuthorizationSection.cs
- BooleanFunctions.cs
- RectKeyFrameCollection.cs
- RawStylusInput.cs
- CqlWriter.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- Attribute.cs
- TextModifierScope.cs
- XmlKeywords.cs
- ValidatorCollection.cs
- ILGen.cs
- PolyLineSegment.cs
- BinHexDecoder.cs
- Matrix3D.cs
- FlowLayout.cs
- StoreItemCollection.cs
- DataKeyArray.cs
- MouseGestureConverter.cs
- DictionarySurrogate.cs
- StaticSiteMapProvider.cs
- SnapLine.cs
- QueryStringParameter.cs
- LocalValueEnumerator.cs
- FixedFindEngine.cs
- CodeDomConfigurationHandler.cs
- WebBrowserNavigatingEventHandler.cs
- MergePropertyDescriptor.cs
- Int32Collection.cs
- Set.cs
- XslException.cs
- TerminatorSinks.cs
- KnownBoxes.cs
- TextParagraph.cs
- Application.cs
- RegexWorker.cs
- CodeMethodInvokeExpression.cs
- RegexFCD.cs
- WebBrowserEvent.cs
- CorePropertiesFilter.cs
- MultiPropertyDescriptorGridEntry.cs
- SHA512Cng.cs
- TypedTableBase.cs
- ToolboxItemWrapper.cs
- ColorConvertedBitmapExtension.cs
- XmlILCommand.cs
- AuthenticationSection.cs
- PlacementWorkspace.cs
- SharedPersonalizationStateInfo.cs
- DataGridViewCheckBoxColumn.cs
- ShaderEffect.cs
- WeakEventManager.cs
- CachedFontFace.cs
- FamilyTypefaceCollection.cs
- CustomErrorsSectionWrapper.cs
- FieldBuilder.cs
- ProfileInfo.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- FullTextState.cs
- XmlCompatibilityReader.cs
- WmlPhoneCallAdapter.cs
- RepeatButtonAutomationPeer.cs
- ToolStripDropDownButton.cs
- EntityFunctions.cs
- Vector3DCollectionConverter.cs
- EventToken.cs
- ComplexLine.cs
- ApplicationFileParser.cs
- WindowsFormsHelpers.cs
- LogEntrySerializationException.cs
- DirectionalLight.cs
- connectionpool.cs
- SQLInt16.cs
- TileModeValidation.cs
- Types.cs
- ColorMap.cs