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
- Rights.cs
- _HTTPDateParse.cs
- PageRequestManager.cs
- ReadOnlyHierarchicalDataSourceView.cs
- TreeViewImageKeyConverter.cs
- RoleService.cs
- EdmError.cs
- Ops.cs
- ReachDocumentSequenceSerializerAsync.cs
- TypedTableBase.cs
- PersonalizationDictionary.cs
- ComponentCommands.cs
- GeneralTransform3D.cs
- ConnectionProviderAttribute.cs
- CodeCommentStatement.cs
- ToolboxComponentsCreatedEventArgs.cs
- VarRemapper.cs
- PageAdapter.cs
- PathData.cs
- XmlSecureResolver.cs
- DetailsViewUpdatedEventArgs.cs
- ConstrainedDataObject.cs
- Config.cs
- FusionWrap.cs
- IndependentlyAnimatedPropertyMetadata.cs
- odbcmetadatacolumnnames.cs
- RuntimeCompatibilityAttribute.cs
- TreeNodeEventArgs.cs
- UTF7Encoding.cs
- CodeTypeReferenceExpression.cs
- HttpCookiesSection.cs
- ComPlusInstanceContextInitializer.cs
- XmlHierarchicalDataSourceView.cs
- HotSpotCollection.cs
- DataGridViewButtonColumn.cs
- PatternMatcher.cs
- TabItemAutomationPeer.cs
- COM2FontConverter.cs
- LabelEditEvent.cs
- Parser.cs
- IntSecurity.cs
- CustomPeerResolverService.cs
- DefaultAsyncDataDispatcher.cs
- ArgumentDirectionHelper.cs
- PersonalizableAttribute.cs
- DataGridViewImageCell.cs
- EnvelopedPkcs7.cs
- XmlnsDefinitionAttribute.cs
- UserPersonalizationStateInfo.cs
- MenuCommands.cs
- DataViewManager.cs
- RtType.cs
- QuaternionAnimation.cs
- NotFiniteNumberException.cs
- Metafile.cs
- SolidColorBrush.cs
- ConfigurationManagerInternal.cs
- BookmarkResumptionRecord.cs
- PeerCollaboration.cs
- TextBox.cs
- DataRowComparer.cs
- DataObjectEventArgs.cs
- Activation.cs
- Win32.cs
- shaper.cs
- XPathNavigatorReader.cs
- EntityObject.cs
- ProvidersHelper.cs
- serverconfig.cs
- MembershipUser.cs
- DataColumnPropertyDescriptor.cs
- GlobalizationAssembly.cs
- EventWaitHandleSecurity.cs
- Label.cs
- SafeUserTokenHandle.cs
- X509ChainElement.cs
- XPathPatternBuilder.cs
- WindowsRebar.cs
- ScrollBarRenderer.cs
- TypeProvider.cs
- TextAction.cs
- RegexInterpreter.cs
- FunctionCommandText.cs
- ReliableMessagingHelpers.cs
- Section.cs
- FixedFindEngine.cs
- SmtpTransport.cs
- BinaryFormatterWriter.cs
- PropertiesTab.cs
- PrintController.cs
- DependencyPropertyDescriptor.cs
- EdmPropertyAttribute.cs
- XmlConvert.cs
- ImageInfo.cs
- Int32CAMarshaler.cs
- ByeMessageCD1.cs
- UserControl.cs
- Internal.cs
- EntryPointNotFoundException.cs
- XComponentModel.cs