Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- GroupItem.cs
- DataServiceRequestArgs.cs
- CompiledRegexRunnerFactory.cs
- BooleanConverter.cs
- SqlCacheDependencySection.cs
- Lease.cs
- PropertyCollection.cs
- MarginCollapsingState.cs
- WebServiceMethodData.cs
- IdentitySection.cs
- WinCategoryAttribute.cs
- Configuration.cs
- SizeF.cs
- ConnectionConsumerAttribute.cs
- OletxCommittableTransaction.cs
- StorageRoot.cs
- StoreAnnotationsMap.cs
- ControlBuilder.cs
- ReflectionTypeLoadException.cs
- KeyValuePair.cs
- SiteMap.cs
- XmlChildEnumerator.cs
- DataGridViewComboBoxColumn.cs
- DescendentsWalker.cs
- ThreadStateException.cs
- ReachIDocumentPaginatorSerializer.cs
- ImageKeyConverter.cs
- sqlstateclientmanager.cs
- DependencyProperty.cs
- ExceptionHelpers.cs
- TextSelectionProcessor.cs
- DoubleConverter.cs
- TypeEnumerableViewSchema.cs
- PartitionResolver.cs
- X509KeyIdentifierClauseType.cs
- ActivityMarkupSerializationProvider.cs
- SrgsElementFactoryCompiler.cs
- Root.cs
- ProgressBar.cs
- IsolatedStorage.cs
- ClientProxyGenerator.cs
- wgx_commands.cs
- CollectionBase.cs
- ThaiBuddhistCalendar.cs
- LinkLabel.cs
- ShaderRenderModeValidation.cs
- TableItemStyle.cs
- WindowsPrincipal.cs
- AutoGeneratedFieldProperties.cs
- ThicknessAnimation.cs
- ParameterModifier.cs
- CodeGroup.cs
- ObjectCloneHelper.cs
- ReaderWriterLock.cs
- HScrollBar.cs
- List.cs
- Cloud.cs
- CdpEqualityComparer.cs
- RequestFactory.cs
- MultitargetingHelpers.cs
- GetIndexBinder.cs
- DocumentEventArgs.cs
- KnownTypesProvider.cs
- RIPEMD160.cs
- HtmlUtf8RawTextWriter.cs
- PropertyRecord.cs
- SecureUICommand.cs
- EventDescriptor.cs
- CheckBoxStandardAdapter.cs
- SafeProcessHandle.cs
- IPHostEntry.cs
- StyleXamlTreeBuilder.cs
- TableLayoutCellPaintEventArgs.cs
- Trigger.cs
- Menu.cs
- SmtpException.cs
- COM2PictureConverter.cs
- TdsParser.cs
- TargetControlTypeAttribute.cs
- ObjectResult.cs
- WebPartVerb.cs
- EmissiveMaterial.cs
- ScrollChrome.cs
- ProjectionCamera.cs
- ErrorItem.cs
- ComboBox.cs
- Int16Storage.cs
- LinqDataSourceContextEventArgs.cs
- SQLDecimalStorage.cs
- Popup.cs
- AutomationPropertyChangedEventArgs.cs
- QueryStringParameter.cs
- StringSorter.cs
- BlockUIContainer.cs
- COM2ComponentEditor.cs
- ColorTranslator.cs
- FileBasedResourceGroveler.cs
- GridEntry.cs
- OdbcUtils.cs
- Tracer.cs