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
- InputMethod.cs
- MaterialGroup.cs
- ObjectParameterCollection.cs
- SqlCommandSet.cs
- SspiWrapper.cs
- DataBindingExpressionBuilder.cs
- ConstructorNeedsTagAttribute.cs
- PaintEvent.cs
- EditorPartCollection.cs
- RegexStringValidatorAttribute.cs
- SqlCacheDependency.cs
- XsltCompileContext.cs
- WriteTimeStream.cs
- XsdSchemaFileEditor.cs
- CompilerScope.cs
- ManagedIStream.cs
- LineGeometry.cs
- NativeMethods.cs
- TableLayoutSettings.cs
- InternalMappingException.cs
- ListCommandEventArgs.cs
- GeneratedCodeAttribute.cs
- GridViewHeaderRowPresenter.cs
- GridViewDeleteEventArgs.cs
- OrderedHashRepartitionEnumerator.cs
- UInt64Storage.cs
- HttpValueCollection.cs
- ConnectionStringsExpressionBuilder.cs
- Char.cs
- Grammar.cs
- DesignerActionItemCollection.cs
- TrimSurroundingWhitespaceAttribute.cs
- SoundPlayerAction.cs
- FileUpload.cs
- TransformerConfigurationWizardBase.cs
- _HelperAsyncResults.cs
- ClaimComparer.cs
- BinaryCommonClasses.cs
- ButtonChrome.cs
- DataStreamFromComStream.cs
- WebAdminConfigurationHelper.cs
- MobileControlsSectionHandler.cs
- FontDifferentiator.cs
- EventRoute.cs
- FontSizeConverter.cs
- CodeIdentifiers.cs
- CodeTryCatchFinallyStatement.cs
- QilVisitor.cs
- ConfigurationStrings.cs
- XsdValidatingReader.cs
- WebPartCloseVerb.cs
- ClientApiGenerator.cs
- SchemaTypeEmitter.cs
- SafeRightsManagementQueryHandle.cs
- RuleProcessor.cs
- PrintPreviewGraphics.cs
- ContractReference.cs
- TableLayoutCellPaintEventArgs.cs
- WebConfigurationFileMap.cs
- LogicalCallContext.cs
- Parameter.cs
- XPathBinder.cs
- AnnotationObservableCollection.cs
- CSharpCodeProvider.cs
- TreeNodeEventArgs.cs
- LocalizationComments.cs
- HeaderedContentControl.cs
- CryptoProvider.cs
- InkCanvasSelectionAdorner.cs
- ShapeTypeface.cs
- EntityException.cs
- OrderablePartitioner.cs
- RegisteredScript.cs
- DBNull.cs
- PropertySegmentSerializationProvider.cs
- TextDecorations.cs
- ProxyWebPartManager.cs
- OneWayElement.cs
- DesignerDataTableBase.cs
- QuaternionAnimation.cs
- DataSourceProvider.cs
- ToolTip.cs
- JavaScriptSerializer.cs
- OdbcConnectionOpen.cs
- DataBindingsDialog.cs
- DataSourceComponent.cs
- Accessible.cs
- SerializableReadOnlyDictionary.cs
- ColumnResult.cs
- WeakRefEnumerator.cs
- FixedFlowMap.cs
- XmlAttribute.cs
- StorageEndPropertyMapping.cs
- ProcessHostMapPath.cs
- ToolStripItem.cs
- ContentTypeSettingClientMessageFormatter.cs
- WpfXamlLoader.cs
- BrowserDefinition.cs
- NotSupportedException.cs
- GenericsInstances.cs