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
- StringFunctions.cs
- ReadOnlyHierarchicalDataSource.cs
- BaseCodePageEncoding.cs
- CqlLexerHelpers.cs
- TaiwanCalendar.cs
- DoubleLink.cs
- Rect3D.cs
- ClientSponsor.cs
- HtmlShim.cs
- HebrewCalendar.cs
- AutomationAttributeInfo.cs
- ComboBox.cs
- HtmlUtf8RawTextWriter.cs
- HtmlInputButton.cs
- SystemUnicastIPAddressInformation.cs
- MetadataSource.cs
- ResourceWriter.cs
- AddInContractAttribute.cs
- ZeroOpNode.cs
- RTLAwareMessageBox.cs
- MiniAssembly.cs
- RowToParametersTransformer.cs
- PropertyNames.cs
- DesignerTransactionCloseEvent.cs
- DataListCommandEventArgs.cs
- HtmlEmptyTagControlBuilder.cs
- SqlDataSourceCustomCommandEditor.cs
- QueryOptionExpression.cs
- ValidationError.cs
- CompiledIdentityConstraint.cs
- PropertyEntry.cs
- Pointer.cs
- RectAnimation.cs
- ConfigurationStrings.cs
- XmlBinaryWriterSession.cs
- ScriptControl.cs
- EntityCollection.cs
- ScriptResourceInfo.cs
- Ray3DHitTestResult.cs
- WindowsComboBox.cs
- GZipStream.cs
- IncrementalReadDecoders.cs
- GroupStyle.cs
- GetMemberBinder.cs
- versioninfo.cs
- RequestCachingSection.cs
- ToolStripItemImageRenderEventArgs.cs
- XmlLinkedNode.cs
- ContentIterators.cs
- SqlCharStream.cs
- WriteableOnDemandPackagePart.cs
- StringExpressionSet.cs
- VisualStyleInformation.cs
- QilInvokeEarlyBound.cs
- IdleTimeoutMonitor.cs
- DefaultPropertyAttribute.cs
- DrawingVisualDrawingContext.cs
- FloaterParaClient.cs
- RelationshipManager.cs
- SynchronizingStream.cs
- Constraint.cs
- DataSourceXmlElementAttribute.cs
- TextContainerChangeEventArgs.cs
- FormViewModeEventArgs.cs
- Selector.cs
- TargetException.cs
- ImportContext.cs
- SQLDateTime.cs
- RegisteredArrayDeclaration.cs
- ToolStripItemTextRenderEventArgs.cs
- ToolStripEditorManager.cs
- SafeArrayTypeMismatchException.cs
- OleDbException.cs
- DataTableExtensions.cs
- QilXmlWriter.cs
- ByeOperationCD1AsyncResult.cs
- PixelFormatConverter.cs
- TextBoxLine.cs
- HyperLinkDesigner.cs
- DbException.cs
- HtmlLinkAdapter.cs
- TrustLevel.cs
- StylusPointPropertyInfoDefaults.cs
- ServiceOperationWrapper.cs
- BooleanKeyFrameCollection.cs
- BooleanExpr.cs
- SQLResource.cs
- MethodImplAttribute.cs
- PriorityChain.cs
- TreeNodeBinding.cs
- OleTxTransactionInfo.cs
- VerbConverter.cs
- SpecialTypeDataContract.cs
- HtmlProps.cs
- GridItemCollection.cs
- DataGridRowAutomationPeer.cs
- EmissiveMaterial.cs
- SecondaryViewProvider.cs
- Graphics.cs
- TextRangeAdaptor.cs