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
- SurrogateEncoder.cs
- BasePropertyDescriptor.cs
- DataExpression.cs
- DoubleAnimation.cs
- EntityKeyElement.cs
- DynamicRendererThreadManager.cs
- FileDialog_Vista.cs
- ProvidersHelper.cs
- HttpResponse.cs
- TypeNameConverter.cs
- DataContractSerializerOperationGenerator.cs
- KeyValueConfigurationCollection.cs
- WorkflowExecutor.cs
- WebPartEditorCancelVerb.cs
- ProcessRequestArgs.cs
- ParallelTimeline.cs
- ComplusTypeValidator.cs
- UiaCoreProviderApi.cs
- ParserStreamGeometryContext.cs
- HttpRequestTraceRecord.cs
- LogAppendAsyncResult.cs
- XLinq.cs
- QueryExtender.cs
- MenuItemStyleCollection.cs
- HttpHostedTransportConfiguration.cs
- EndEvent.cs
- ByeMessage11.cs
- ADMembershipProvider.cs
- TypeDescriptionProviderAttribute.cs
- DataGridViewCellValueEventArgs.cs
- printdlgexmarshaler.cs
- AudienceUriMode.cs
- InertiaTranslationBehavior.cs
- WMIGenerator.cs
- WebReference.cs
- WindowsAuthenticationEventArgs.cs
- TemplateBaseAction.cs
- SmtpReplyReader.cs
- Predicate.cs
- ECDiffieHellmanCngPublicKey.cs
- SettingsPropertyValueCollection.cs
- InternalConfigSettingsFactory.cs
- TextProviderWrapper.cs
- ConnectionProviderAttribute.cs
- NullRuntimeConfig.cs
- DecimalConverter.cs
- Delegate.cs
- ProviderBase.cs
- WorkflowRuntimeElement.cs
- ListView.cs
- ListViewItemSelectionChangedEvent.cs
- ObservableDictionary.cs
- ContextQuery.cs
- WorkerRequest.cs
- BaseConfigurationRecord.cs
- AppDomainUnloadedException.cs
- Animatable.cs
- ScriptingJsonSerializationSection.cs
- XPathAncestorQuery.cs
- ProviderBase.cs
- StringInfo.cs
- InvalidFilterCriteriaException.cs
- XamlBuildProvider.cs
- remotingproxy.cs
- RunWorkerCompletedEventArgs.cs
- HttpDigestClientElement.cs
- SpecialFolderEnumConverter.cs
- FixedTextView.cs
- ExtentKey.cs
- LabelAutomationPeer.cs
- GroupItem.cs
- StringUtil.cs
- DesignerTransactionCloseEvent.cs
- DbTransaction.cs
- CssTextWriter.cs
- AsnEncodedData.cs
- DataGrid.cs
- Span.cs
- ItemCheckEvent.cs
- StylusTip.cs
- CommandField.cs
- XmlQueryStaticData.cs
- OrthographicCamera.cs
- XmlUTF8TextReader.cs
- PersonalizationProvider.cs
- SamlDelegatingWriter.cs
- AssemblyInfo.cs
- ClrProviderManifest.cs
- TileBrush.cs
- DBCSCodePageEncoding.cs
- SafeNativeMethods.cs
- MILUtilities.cs
- SystemInformation.cs
- BulletChrome.cs
- DefaultEventAttribute.cs
- ClientTargetSection.cs
- ImportOptions.cs
- translator.cs
- DbDataAdapter.cs
- ToolStripItem.cs