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
- XmlDataProvider.cs
- HtmlTableCellCollection.cs
- ListViewInsertedEventArgs.cs
- DynamicDataResources.Designer.cs
- SystemDropShadowChrome.cs
- CanonicalizationDriver.cs
- CommandConverter.cs
- HTTPRemotingHandler.cs
- Rfc2898DeriveBytes.cs
- FieldAccessException.cs
- RsaEndpointIdentity.cs
- ISCIIEncoding.cs
- RequestSecurityTokenResponse.cs
- HandleExceptionArgs.cs
- DrawingAttributesDefaultValueFactory.cs
- DefaultDialogButtons.cs
- EntityDataSourceWizardForm.cs
- FormViewInsertEventArgs.cs
- DataControlHelper.cs
- DisplayInformation.cs
- ConfigurationLocation.cs
- StylusPoint.cs
- TagElement.cs
- SystemNetworkInterface.cs
- UriScheme.cs
- PeerNameRecord.cs
- FormatConvertedBitmap.cs
- XmlSchemaSimpleContent.cs
- ColumnWidthChangedEvent.cs
- TransformGroup.cs
- SourceItem.cs
- RtfNavigator.cs
- XmlBinaryWriterSession.cs
- PropertyCondition.cs
- WebBrowserDocumentCompletedEventHandler.cs
- RankException.cs
- TableRowGroup.cs
- FixedHighlight.cs
- ListenerConfig.cs
- GuidConverter.cs
- HMACSHA384.cs
- ToolStripDropDownItemDesigner.cs
- MimeTypePropertyAttribute.cs
- AvTraceFormat.cs
- Encoder.cs
- ListViewUpdateEventArgs.cs
- ColumnReorderedEventArgs.cs
- XmlReader.cs
- Accessible.cs
- PersonalizationStateQuery.cs
- SerializationSectionGroup.cs
- ActivitiesCollection.cs
- Opcode.cs
- Pair.cs
- AssemblySettingAttributes.cs
- TypeBinaryExpression.cs
- BlobPersonalizationState.cs
- LineProperties.cs
- XmlDomTextWriter.cs
- EventLogRecord.cs
- WebBaseEventKeyComparer.cs
- ThreadPool.cs
- OrderedDictionaryStateHelper.cs
- DictionaryContent.cs
- UnionQueryOperator.cs
- ReferencedAssembly.cs
- ColorAnimationUsingKeyFrames.cs
- ObjectResult.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- ListViewInsertedEventArgs.cs
- XslTransform.cs
- RegexCode.cs
- DataGridViewIntLinkedList.cs
- LayoutInformation.cs
- WorkflowMarkupSerializerMapping.cs
- SqlMethodCallConverter.cs
- DataGridSortingEventArgs.cs
- EntityDataSourceChangingEventArgs.cs
- SourceFilter.cs
- BackgroundWorker.cs
- MasterPage.cs
- UntypedNullExpression.cs
- BitmapCache.cs
- DataObject.cs
- TextMarkerSource.cs
- SystemColors.cs
- PersistNameAttribute.cs
- MessagePropertyFilter.cs
- FigureParaClient.cs
- PhysicalFontFamily.cs
- MessageDroppedTraceRecord.cs
- ConfigurationFileMap.cs
- DefaultPrintController.cs
- BindableAttribute.cs
- SqlInternalConnection.cs
- SubMenuStyle.cs
- PersonalizationState.cs
- RoutingChannelExtension.cs
- MemoryMappedFileSecurity.cs
- TypeResolver.cs