Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- MetadataPropertyCollection.cs
- ConsoleKeyInfo.cs
- ResXFileRef.cs
- CommentEmitter.cs
- SecureStringHasher.cs
- FileDialogCustomPlace.cs
- CloudCollection.cs
- TargetException.cs
- TypeRestriction.cs
- HotSpotCollection.cs
- SessionState.cs
- SimpleHandlerBuildProvider.cs
- HashSetDebugView.cs
- PolyLineSegment.cs
- SmuggledIUnknown.cs
- Pkcs7Signer.cs
- CultureData.cs
- NonVisualControlAttribute.cs
- SchemaNamespaceManager.cs
- KeyValueSerializer.cs
- ComplexTypeEmitter.cs
- DiscoveryRequestHandler.cs
- TextFindEngine.cs
- Storyboard.cs
- TextBoxAutoCompleteSourceConverter.cs
- KeySpline.cs
- SqlUDTStorage.cs
- HtmlTitle.cs
- hwndwrapper.cs
- InvokeGenerator.cs
- SourceChangedEventArgs.cs
- WebConfigurationFileMap.cs
- StrongTypingException.cs
- NativeObjectSecurity.cs
- WebPartVerbsEventArgs.cs
- TTSVoice.cs
- EncoderBestFitFallback.cs
- PropertyChangedEventArgs.cs
- ControlParameter.cs
- InvalidAsynchronousStateException.cs
- TextFormattingConverter.cs
- EntityDataSourceChangedEventArgs.cs
- basemetadatamappingvisitor.cs
- HtmlHead.cs
- PreservationFileWriter.cs
- Win32SafeHandles.cs
- ClientConfigurationSystem.cs
- DataGridPageChangedEventArgs.cs
- ProxyElement.cs
- ObjRef.cs
- TypeSource.cs
- ColorAnimationBase.cs
- HttpCookiesSection.cs
- StringOutput.cs
- CodeTypeDeclaration.cs
- Cloud.cs
- QueryOutputWriter.cs
- LinqDataView.cs
- PersonalizationStateInfo.cs
- PkcsMisc.cs
- FormsAuthenticationTicket.cs
- TemplateBaseAction.cs
- NetTcpSection.cs
- SaveFileDialog.cs
- ConnectionInterfaceCollection.cs
- BasicExpressionVisitor.cs
- RowVisual.cs
- TraceProvider.cs
- XmlSerializerImportOptions.cs
- InstallerTypeAttribute.cs
- RangeBase.cs
- baseshape.cs
- WebPartConnectionCollection.cs
- ListBindableAttribute.cs
- FrameworkContentElement.cs
- WebPartEditVerb.cs
- UpdateRecord.cs
- Brush.cs
- TextRange.cs
- URIFormatException.cs
- UpdateManifestForBrowserApplication.cs
- ListViewDataItem.cs
- Visual3D.cs
- HttpRawResponse.cs
- WebServiceParameterData.cs
- StorageModelBuildProvider.cs
- FeedUtils.cs
- SizeConverter.cs
- StatusBarAutomationPeer.cs
- WebPartAuthorizationEventArgs.cs
- VariableQuery.cs
- CounterSampleCalculator.cs
- DecoderFallback.cs
- WebHttpBinding.cs
- AddingNewEventArgs.cs
- FixedTextSelectionProcessor.cs
- Simplifier.cs
- SettingsPropertyWrongTypeException.cs
- DataKey.cs
- ContentHostHelper.cs