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
- EntityClassGenerator.cs
- SaveFileDialog.cs
- CustomSignedXml.cs
- XmlSignificantWhitespace.cs
- tibetanshape.cs
- Char.cs
- UInt32Storage.cs
- SHA512Cng.cs
- TimeSpanStorage.cs
- CharStorage.cs
- GuidelineCollection.cs
- CompensationTokenData.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- RunInstallerAttribute.cs
- FontConverter.cs
- InlineObject.cs
- TemplatedWizardStep.cs
- TextRangeEdit.cs
- PersonalizationStateInfo.cs
- XmlLanguage.cs
- StringComparer.cs
- AssemblyAttributesGoHere.cs
- UrlMappingCollection.cs
- Types.cs
- PropertyGeneratedEventArgs.cs
- XamlWrapperReaders.cs
- PolicyLevel.cs
- PropertySourceInfo.cs
- LocalizedNameDescriptionPair.cs
- FileCodeGroup.cs
- SqlConnectionPoolProviderInfo.cs
- MarkedHighlightComponent.cs
- DecimalStorage.cs
- CommonDialog.cs
- ObjectStateManagerMetadata.cs
- InstanceKey.cs
- Transactions.cs
- ControlIdConverter.cs
- Style.cs
- DataGridViewComboBoxColumn.cs
- FacetEnabledSchemaElement.cs
- EventMappingSettingsCollection.cs
- Overlapped.cs
- ValidationSummary.cs
- DefaultHttpHandler.cs
- Rfc2898DeriveBytes.cs
- SafeNativeMethodsMilCoreApi.cs
- CodeStatement.cs
- RadioButtonBaseAdapter.cs
- EdmToObjectNamespaceMap.cs
- AdornerPresentationContext.cs
- SqlAggregateChecker.cs
- ListDictionaryInternal.cs
- XmlWrappingReader.cs
- ConfigurationManagerInternalFactory.cs
- ZipIOLocalFileBlock.cs
- Attributes.cs
- ElementsClipboardData.cs
- InternalMappingException.cs
- CounterSetInstanceCounterDataSet.cs
- SqlDataSourceCache.cs
- PropertyMapper.cs
- DataGridComboBoxColumn.cs
- OperationCanceledException.cs
- PanelStyle.cs
- FormViewCommandEventArgs.cs
- DisplayInformation.cs
- ComEventsHelper.cs
- TimersDescriptionAttribute.cs
- GeometryModel3D.cs
- AppDomainUnloadedException.cs
- CollectionChangeEventArgs.cs
- LineVisual.cs
- SecurityPolicyVersion.cs
- FileUtil.cs
- ParameterToken.cs
- PointCollection.cs
- NameNode.cs
- sqlstateclientmanager.cs
- QilUnary.cs
- SpnegoTokenAuthenticator.cs
- DataGridSortCommandEventArgs.cs
- DependencyPropertyKind.cs
- MenuTracker.cs
- XDeferredAxisSource.cs
- NullableDoubleSumAggregationOperator.cs
- TemplateInstanceAttribute.cs
- GacUtil.cs
- CharEntityEncoderFallback.cs
- DirectoryNotFoundException.cs
- BlurEffect.cs
- DbConnectionPoolGroup.cs
- TransformDescriptor.cs
- EastAsianLunisolarCalendar.cs
- SchemaCollectionCompiler.cs
- RequiredFieldValidator.cs
- ExpandCollapsePattern.cs
- ModifierKeysConverter.cs
- DockPatternIdentifiers.cs
- CheckBoxList.cs