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
- ConfigurationProperty.cs
- ParamArrayAttribute.cs
- ListDictionaryInternal.cs
- GeometryCollection.cs
- Transform.cs
- FormatterConverter.cs
- ComponentDispatcher.cs
- TextCollapsingProperties.cs
- ToolStripRenderer.cs
- ItemContainerPattern.cs
- GridViewCommandEventArgs.cs
- METAHEADER.cs
- GenericUriParser.cs
- LocalizationComments.cs
- AnnotationHighlightLayer.cs
- XmlILConstructAnalyzer.cs
- TextBox.cs
- XamlReaderHelper.cs
- ImageCodecInfo.cs
- PageThemeParser.cs
- ISFClipboardData.cs
- IdentityValidationException.cs
- StatusBarDrawItemEvent.cs
- Contracts.cs
- HttpListener.cs
- ISessionStateStore.cs
- DataGrid.cs
- TypeLoadException.cs
- AutomationPatternInfo.cs
- ArrayItemReference.cs
- SplineQuaternionKeyFrame.cs
- Bezier.cs
- HttpPostLocalhostServerProtocol.cs
- DataSetMappper.cs
- BindStream.cs
- CharAnimationUsingKeyFrames.cs
- SystemIPInterfaceProperties.cs
- WorkflowOperationBehavior.cs
- WebPartVerbCollection.cs
- PageHandlerFactory.cs
- ConfigXmlSignificantWhitespace.cs
- SurrogateDataContract.cs
- SqlStream.cs
- CaseInsensitiveHashCodeProvider.cs
- XmlEventCache.cs
- CriticalHandle.cs
- CorrelationManager.cs
- XPathArrayIterator.cs
- DataViewSettingCollection.cs
- SourceFileBuildProvider.cs
- MoveSizeWinEventHandler.cs
- ApplicationServiceManager.cs
- LayoutUtils.cs
- XsdDuration.cs
- IntSecurity.cs
- OrderToken.cs
- AdapterUtil.cs
- Permission.cs
- HttpCacheVaryByContentEncodings.cs
- ObjectItemCollection.cs
- BaseCAMarshaler.cs
- FontCollection.cs
- WriterOutput.cs
- EntityDesignerDataSourceView.cs
- PolyQuadraticBezierSegment.cs
- DataGridViewImageColumn.cs
- PasswordPropertyTextAttribute.cs
- CodeSubDirectory.cs
- ColorConvertedBitmap.cs
- ModuleConfigurationInfo.cs
- RowCache.cs
- WebFormDesignerActionService.cs
- GridViewRowEventArgs.cs
- OpenFileDialog.cs
- XmlSerializableServices.cs
- AsmxEndpointPickerExtension.cs
- ConsumerConnectionPointCollection.cs
- HttpCookiesSection.cs
- TryExpression.cs
- LinearQuaternionKeyFrame.cs
- TeredoHelper.cs
- SimpleApplicationHost.cs
- LiteralText.cs
- OracleBFile.cs
- BaseTemplateParser.cs
- EventLogLink.cs
- ExtensionWindowHeader.cs
- MarkupWriter.cs
- PreparingEnlistment.cs
- RequestContext.cs
- SqlCharStream.cs
- SocketInformation.cs
- DataGridViewRowsAddedEventArgs.cs
- SupportsEventValidationAttribute.cs
- XPathMessageFilterElementComparer.cs
- WpfGeneratedKnownTypes.cs
- BezierSegment.cs
- WebBrowserEvent.cs
- FileStream.cs
- LocalIdCollection.cs