Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- LinearQuaternionKeyFrame.cs
- FlowDocumentFormatter.cs
- DataFieldConverter.cs
- ClientOperationFormatterProvider.cs
- TableLayoutStyle.cs
- PluralizationService.cs
- PersonalizationStateQuery.cs
- ToolboxItemAttribute.cs
- KnownAssemblyEntry.cs
- ReadOnlyDataSource.cs
- DataSvcMapFileSerializer.cs
- SmtpTransport.cs
- WmpBitmapDecoder.cs
- Normalization.cs
- DataGridCaption.cs
- XmlIlVisitor.cs
- XmlDataSourceView.cs
- HashLookup.cs
- SponsorHelper.cs
- TaskDesigner.cs
- FrameAutomationPeer.cs
- CollectionContainer.cs
- StaticExtensionConverter.cs
- TextTreeRootTextBlock.cs
- TimeManager.cs
- TrustLevelCollection.cs
- CategoryAttribute.cs
- GenericEnumerator.cs
- DataGridCommandEventArgs.cs
- ConnectionPoint.cs
- RowUpdatingEventArgs.cs
- DesignerHost.cs
- UnsafeNativeMethods.cs
- BinaryNode.cs
- BamlRecordWriter.cs
- SQlBooleanStorage.cs
- Tokenizer.cs
- IgnoreSectionHandler.cs
- Int32Converter.cs
- DiagnosticStrings.cs
- Events.cs
- DependencyObjectCodeDomSerializer.cs
- TableRowGroup.cs
- CustomCategoryAttribute.cs
- SecurityDescriptor.cs
- SrgsSemanticInterpretationTag.cs
- RootBrowserWindowProxy.cs
- OleDbPropertySetGuid.cs
- IntegerValidator.cs
- AuthorizationRule.cs
- SecurityBindingElement.cs
- loginstatus.cs
- HttpResponseBase.cs
- XamlParser.cs
- basecomparevalidator.cs
- VectorValueSerializer.cs
- ArgIterator.cs
- XmlSchemaImporter.cs
- ErrorProvider.cs
- HttpModuleActionCollection.cs
- CallbackValidator.cs
- PlainXmlSerializer.cs
- DesignTimeTemplateParser.cs
- TraceUtils.cs
- _UriTypeConverter.cs
- Panel.cs
- RegisteredArrayDeclaration.cs
- AllMembershipCondition.cs
- rsa.cs
- MtomMessageEncoder.cs
- DataGridViewCellCancelEventArgs.cs
- ResourceExpressionBuilder.cs
- Documentation.cs
- KeyMatchBuilder.cs
- StrongNameKeyPair.cs
- DataControlPagerLinkButton.cs
- RTLAwareMessageBox.cs
- ClientScriptManager.cs
- XmlSchemaParticle.cs
- SiteMap.cs
- CompiledIdentityConstraint.cs
- LogicalTreeHelper.cs
- BufferBuilder.cs
- MenuAutoFormat.cs
- WebPartActionVerb.cs
- StandardCommands.cs
- Sql8ConformanceChecker.cs
- Buffer.cs
- webeventbuffer.cs
- MappedMetaModel.cs
- SQLByte.cs
- ListenerServiceInstallComponent.cs
- documentsequencetextpointer.cs
- _SslState.cs
- WeakEventTable.cs
- ContainerParaClient.cs
- ProgressBarRenderer.cs
- _MultipleConnectAsync.cs
- CompositeActivityTypeDescriptor.cs
- XmlSchemaType.cs