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
- StreamingContext.cs
- MethodAccessException.cs
- BrowserCapabilitiesFactoryBase.cs
- CurrentChangingEventManager.cs
- TypedElement.cs
- CompositeCollectionView.cs
- GridViewUpdateEventArgs.cs
- MsmqAppDomainProtocolHandler.cs
- ExpiredSecurityTokenException.cs
- GradientStop.cs
- DebugInfoGenerator.cs
- bidPrivateBase.cs
- InstanceDataCollection.cs
- PropertyKey.cs
- ListBoxItemWrapperAutomationPeer.cs
- ErrorWrapper.cs
- XmlRawWriterWrapper.cs
- ContentPosition.cs
- ParameterElement.cs
- PreviewPrintController.cs
- XhtmlBasicCommandAdapter.cs
- PartialArray.cs
- _LocalDataStore.cs
- ParallelForEach.cs
- ICspAsymmetricAlgorithm.cs
- XmlDocumentFragment.cs
- FastPropertyAccessor.cs
- ImageCodecInfo.cs
- Decoder.cs
- QuaternionAnimation.cs
- Hashtable.cs
- ClipboardData.cs
- StylusPoint.cs
- autovalidator.cs
- PostBackOptions.cs
- ToolStripItemGlyph.cs
- PassportPrincipal.cs
- BatchStream.cs
- AuthorizationRuleCollection.cs
- FixedSOMTextRun.cs
- LocalBuilder.cs
- SingleSelectRootGridEntry.cs
- CacheVirtualItemsEvent.cs
- RegularExpressionValidator.cs
- RegisteredDisposeScript.cs
- TrustSection.cs
- oledbmetadatacollectionnames.cs
- SoapObjectReader.cs
- Pkcs9Attribute.cs
- TemplateColumn.cs
- DataDocumentXPathNavigator.cs
- DrawListViewColumnHeaderEventArgs.cs
- SchemaImporterExtensionElement.cs
- DocumentPageHost.cs
- documentation.cs
- UriParserTemplates.cs
- OdbcStatementHandle.cs
- TemplateInstanceAttribute.cs
- SymbolType.cs
- MarkupCompilePass2.cs
- SemanticBasicElement.cs
- QualificationDataAttribute.cs
- HttpCookie.cs
- SkipStoryboardToFill.cs
- Screen.cs
- Control.cs
- AssemblyAttributes.cs
- FixedFlowMap.cs
- SourceFileBuildProvider.cs
- InstalledFontCollection.cs
- NegotiateStream.cs
- WorkflowViewService.cs
- FederatedMessageSecurityOverHttp.cs
- StringFunctions.cs
- VirtualPath.cs
- CodeIdentifier.cs
- AlignmentXValidation.cs
- SharedHttpTransportManager.cs
- XmlAggregates.cs
- StrokeCollectionConverter.cs
- StringValueSerializer.cs
- ScrollChrome.cs
- RangeExpression.cs
- IdentityNotMappedException.cs
- EventItfInfo.cs
- ToolstripProfessionalRenderer.cs
- Visitor.cs
- Rotation3DAnimation.cs
- DataGridViewControlCollection.cs
- Privilege.cs
- SqlNotificationEventArgs.cs
- SessionStateSection.cs
- DoubleLink.cs
- Visitors.cs
- HttpStreamXmlDictionaryWriter.cs
- AuthStoreRoleProvider.cs
- ListViewCancelEventArgs.cs
- EditableRegion.cs
- GenericAuthenticationEventArgs.cs
- URIFormatException.cs