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
- GiveFeedbackEventArgs.cs
- SafeNativeMethods.cs
- BeginEvent.cs
- PeerContact.cs
- TerminatorSinks.cs
- DbProviderFactoriesConfigurationHandler.cs
- StackSpiller.Generated.cs
- FileDetails.cs
- PropertyDescriptorGridEntry.cs
- StylusLogic.cs
- CompilerScopeManager.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- FormsIdentity.cs
- FileNotFoundException.cs
- ValueProviderWrapper.cs
- IntranetCredentialPolicy.cs
- WebPartHeaderCloseVerb.cs
- Solver.cs
- KnownIds.cs
- TreeWalkHelper.cs
- AdornerDecorator.cs
- FileDialogCustomPlacesCollection.cs
- CryptoHelper.cs
- RegisteredHiddenField.cs
- ReferenceConverter.cs
- PlainXmlSerializer.cs
- RemoteWebConfigurationHostStream.cs
- WindowsListView.cs
- SQLInt64Storage.cs
- DiagnosticTrace.cs
- Set.cs
- ConstraintStruct.cs
- RemotingService.cs
- SmtpException.cs
- TabOrder.cs
- ContractListAdapter.cs
- ImageSource.cs
- WmiEventSink.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- SelectiveScrollingGrid.cs
- XmlIlVisitor.cs
- TimeSpanStorage.cs
- SortableBindingList.cs
- IdentityValidationException.cs
- PerformanceCounter.cs
- StrokeCollectionDefaultValueFactory.cs
- MouseDevice.cs
- TextRangeAdaptor.cs
- SingleStorage.cs
- X509ThumbprintKeyIdentifierClause.cs
- ObjectListShowCommandsEventArgs.cs
- Update.cs
- ObjectQuery.cs
- AssemblyAssociatedContentFileAttribute.cs
- DbDataAdapter.cs
- Semaphore.cs
- ExtendedPropertyDescriptor.cs
- RegexCode.cs
- SqlDataSourceConfigureSortForm.cs
- DataReaderContainer.cs
- CheckBoxPopupAdapter.cs
- AdRotator.cs
- MgmtConfigurationRecord.cs
- ConditionCollection.cs
- ExpressionPrefixAttribute.cs
- Path.cs
- BasicExpandProvider.cs
- ThreadBehavior.cs
- IdnMapping.cs
- ThreadStaticAttribute.cs
- SQLMembershipProvider.cs
- SupportingTokenParameters.cs
- LoadItemsEventArgs.cs
- TextTreeText.cs
- SByte.cs
- ProcessThread.cs
- BorderSidesEditor.cs
- WebPartActionVerb.cs
- FormatterServices.cs
- GroupBoxDesigner.cs
- WindowsEditBoxRange.cs
- __ComObject.cs
- SafeFileMappingHandle.cs
- NativeMethods.cs
- BindingElement.cs
- SessionStateModule.cs
- NativeMethods.cs
- CallbackValidator.cs
- ConstraintCollection.cs
- HwndHost.cs
- PenCursorManager.cs
- VarInfo.cs
- SizeValueSerializer.cs
- ConstructorBuilder.cs
- SecurityKeyUsage.cs
- X509Certificate2Collection.cs
- UIElementPropertyUndoUnit.cs
- CodeDefaultValueExpression.cs
- ExceptionHandlersDesigner.cs
- XamlWrappingReader.cs