Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Configuration / System / Configuration / NameValueConfigurationElement.cs / 1305376 / 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
- WindowsFormsHostAutomationPeer.cs
- TableLayoutStyle.cs
- MsmqChannelFactoryBase.cs
- HtmlHead.cs
- DesignerRegionMouseEventArgs.cs
- KeyConverter.cs
- InnerItemCollectionView.cs
- HwndSource.cs
- NonBatchDirectoryCompiler.cs
- EventManager.cs
- XmlExceptionHelper.cs
- AdRotator.cs
- GraphicsPathIterator.cs
- UxThemeWrapper.cs
- TextWriterTraceListener.cs
- ButtonBase.cs
- HandleRef.cs
- Zone.cs
- AttributeEmitter.cs
- TypeUtil.cs
- LineSegment.cs
- QueryOpcode.cs
- CallbackException.cs
- LineServicesCallbacks.cs
- SchemaMapping.cs
- HttpModuleActionCollection.cs
- CopyCodeAction.cs
- HttpRequestBase.cs
- ColumnPropertiesGroup.cs
- ProcessHost.cs
- datacache.cs
- SqlSupersetValidator.cs
- XamlSerializer.cs
- milexports.cs
- DataRowComparer.cs
- FrugalList.cs
- LabelLiteral.cs
- TdsParameterSetter.cs
- XmlReader.cs
- SqlDataSource.cs
- BindingsCollection.cs
- SiteMapNodeCollection.cs
- ContainerControl.cs
- Empty.cs
- SettingsAttributes.cs
- BamlTreeNode.cs
- OuterGlowBitmapEffect.cs
- ResolveMatchesCD1.cs
- SmtpCommands.cs
- AssemblyBuilder.cs
- CultureTable.cs
- PaperSize.cs
- DataSourceCache.cs
- AccessDataSource.cs
- EmptyReadOnlyDictionaryInternal.cs
- DownloadProgressEventArgs.cs
- Overlapped.cs
- Rect3D.cs
- AtomContentProperty.cs
- SmiMetaDataProperty.cs
- DeploymentExceptionMapper.cs
- UnsafeNativeMethods.cs
- ColumnCollection.cs
- SelectedDatesCollection.cs
- DocumentDesigner.cs
- TransformValueSerializer.cs
- StructuredProperty.cs
- LineVisual.cs
- ConfigurationStrings.cs
- EntityCommandCompilationException.cs
- IListConverters.cs
- StrokeCollection.cs
- Selection.cs
- LeaseManager.cs
- DoubleLinkList.cs
- HealthMonitoringSectionHelper.cs
- InputReport.cs
- ListViewInsertionMark.cs
- Win32Native.cs
- DataServiceBehavior.cs
- _OSSOCK.cs
- IsolatedStorageFilePermission.cs
- DiscoveryMessageSequence.cs
- Debug.cs
- NativeCppClassAttribute.cs
- Message.cs
- TargetParameterCountException.cs
- WebMessageFormatHelper.cs
- DrawingAttributes.cs
- XPathDocumentNavigator.cs
- ProgressBar.cs
- ImageSourceValueSerializer.cs
- ToolStripPanelRenderEventArgs.cs
- AndMessageFilter.cs
- _BaseOverlappedAsyncResult.cs
- AmbiguousMatchException.cs
- PanelStyle.cs
- MDIClient.cs
- ComplexPropertyEntry.cs
- MapPathBasedVirtualPathProvider.cs