Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- InvocationExpression.cs
- TTSVoice.cs
- categoryentry.cs
- XmlnsDefinitionAttribute.cs
- ListParagraph.cs
- ListViewInsertedEventArgs.cs
- WorkflowInstanceExtensionManager.cs
- OdbcConnectionFactory.cs
- ConnectionInterfaceCollection.cs
- QilTargetType.cs
- EditingContext.cs
- PersonalizationStateInfo.cs
- FormsAuthentication.cs
- InProcStateClientManager.cs
- ThrowHelper.cs
- DataGridViewCellMouseEventArgs.cs
- WrappedKeySecurityToken.cs
- BamlTreeUpdater.cs
- GridViewCellAutomationPeer.cs
- ServiceManager.cs
- DPTypeDescriptorContext.cs
- DbCommandTree.cs
- CustomPopupPlacement.cs
- InvalidAsynchronousStateException.cs
- sqlmetadatafactory.cs
- RegexBoyerMoore.cs
- ConnectorDragDropGlyph.cs
- PropertyDescriptorComparer.cs
- ASCIIEncoding.cs
- PageParserFilter.cs
- WsdlParser.cs
- BevelBitmapEffect.cs
- FilteredDataSetHelper.cs
- EmptyControlCollection.cs
- PassportAuthentication.cs
- Highlights.cs
- TaskFormBase.cs
- ComplexBindingPropertiesAttribute.cs
- KeyNameIdentifierClause.cs
- NumberSubstitution.cs
- EntitySqlQueryCacheEntry.cs
- RetrieveVirtualItemEventArgs.cs
- XmlSchemaParticle.cs
- SwitchCase.cs
- ArglessEventHandlerProxy.cs
- HeaderPanel.cs
- SystemTcpStatistics.cs
- ElementUtil.cs
- MergablePropertyAttribute.cs
- FileDetails.cs
- BindingGroup.cs
- XmlILTrace.cs
- ClientApiGenerator.cs
- MemberProjectedSlot.cs
- GridViewCellAutomationPeer.cs
- TemplatedMailWebEventProvider.cs
- ManagementNamedValueCollection.cs
- _RequestCacheProtocol.cs
- SchemaElementLookUpTable.cs
- TraceSection.cs
- Domain.cs
- HebrewCalendar.cs
- HtmlControl.cs
- WinInetCache.cs
- HostedElements.cs
- GridItemPattern.cs
- ToolStripRenderEventArgs.cs
- AnnotationAuthorChangedEventArgs.cs
- PeerResolverElement.cs
- TiffBitmapDecoder.cs
- BinaryNode.cs
- FolderLevelBuildProvider.cs
- WebPartConnectVerb.cs
- HtmlObjectListAdapter.cs
- sqlcontext.cs
- StringDictionary.cs
- DataTableNewRowEvent.cs
- Logging.cs
- CommandHelper.cs
- BreakRecordTable.cs
- StatusBarPanelClickEvent.cs
- SqlFacetAttribute.cs
- CustomAttributeBuilder.cs
- PenLineJoinValidation.cs
- PaintValueEventArgs.cs
- ErrorFormatterPage.cs
- ValueSerializer.cs
- BindingManagerDataErrorEventArgs.cs
- QueryOperator.cs
- PersonalizationEntry.cs
- ToggleButtonAutomationPeer.cs
- TemplateKeyConverter.cs
- XamlStream.cs
- ConfigurationFileMap.cs
- XmlCharacterData.cs
- QualificationDataAttribute.cs
- ExtensionFile.cs
- XmlSiteMapProvider.cs
- RegexCapture.cs
- IdentityNotMappedException.cs