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
- SiteMapNodeCollection.cs
- TrackingStringDictionary.cs
- DeclarativeConditionsCollection.cs
- TableColumnCollection.cs
- IisTraceListener.cs
- DownloadProgressEventArgs.cs
- MessageFilter.cs
- BindingRestrictions.cs
- StaticTextPointer.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- LinkLabelLinkClickedEvent.cs
- StrokeIntersection.cs
- MatrixTransform.cs
- DockAndAnchorLayout.cs
- ProxyWebPart.cs
- RoleService.cs
- BitmapCache.cs
- EntityReference.cs
- DesignerWebPartChrome.cs
- XmlParser.cs
- HGlobalSafeHandle.cs
- ToolStripComboBox.cs
- UnsafeNativeMethodsMilCoreApi.cs
- MetadataWorkspace.cs
- XmlAttributeAttribute.cs
- XPathDocumentNavigator.cs
- SelectionPatternIdentifiers.cs
- _NtlmClient.cs
- DBNull.cs
- SafeUserTokenHandle.cs
- EventLogPermissionEntry.cs
- AtomServiceDocumentSerializer.cs
- Transform.cs
- ObjectKeyFrameCollection.cs
- RuleInfoComparer.cs
- Switch.cs
- RegexRunnerFactory.cs
- StopStoryboard.cs
- DataGridTable.cs
- RawTextInputReport.cs
- ClosableStream.cs
- DoubleSumAggregationOperator.cs
- MSHTMLHostUtil.cs
- DropDownList.cs
- DocumentEventArgs.cs
- CheckBoxPopupAdapter.cs
- WebPermission.cs
- GridViewRowPresenterBase.cs
- GridViewRowEventArgs.cs
- VerticalAlignConverter.cs
- StsCommunicationException.cs
- HighContrastHelper.cs
- GridViewUpdateEventArgs.cs
- FormViewDesigner.cs
- Token.cs
- MemberPathMap.cs
- SolidColorBrush.cs
- Point3DCollection.cs
- HotSpot.cs
- XPathSelfQuery.cs
- WebServiceHostFactory.cs
- FlowLayoutSettings.cs
- SimpleRecyclingCache.cs
- DownloadProgressEventArgs.cs
- ClosureBinding.cs
- XmlSerializationReader.cs
- FrameworkContentElementAutomationPeer.cs
- Propagator.ExtentPlaceholderCreator.cs
- WebPartDisplayModeEventArgs.cs
- ActivityDesignerResources.cs
- VectorCollectionConverter.cs
- SemaphoreFullException.cs
- WebPartVerb.cs
- CodeTypeDelegate.cs
- CompleteWizardStep.cs
- ControlDesigner.cs
- FaultDescriptionCollection.cs
- IgnoreFlushAndCloseStream.cs
- BrowserTree.cs
- PauseStoryboard.cs
- InternalConfigHost.cs
- SQLGuid.cs
- DataGridViewBand.cs
- CachedCompositeFamily.cs
- PermissionSetEnumerator.cs
- GridErrorDlg.cs
- TemplatedMailWebEventProvider.cs
- Control.cs
- DataGridViewColumnEventArgs.cs
- EntityDesignerDataSourceView.cs
- TextShapeableCharacters.cs
- VerbConverter.cs
- SymmetricCryptoHandle.cs
- HttpServerVarsCollection.cs
- OleDbWrapper.cs
- TextEndOfParagraph.cs
- SymbolType.cs
- safesecurityhelperavalon.cs
- Misc.cs
- BufferedWebEventProvider.cs