Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Configuration / System / Configuration / KeyValueConfigurationElement.cs / 1 / KeyValueConfigurationElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; public class KeyValueConfigurationElement : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propKey = new ConfigurationProperty("key", typeof(string), String.Empty, ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired); private static readonly ConfigurationProperty _propValue = new ConfigurationProperty("value", typeof(string), String.Empty, ConfigurationPropertyOptions.None); static KeyValueConfigurationElement() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propKey); _properties.Add(_propValue); } protected internal override ConfigurationPropertyCollection Properties { get { return _properties; } } bool _needsInit; string _initKey; string _initValue; // // Constructor // internal KeyValueConfigurationElement() { } public KeyValueConfigurationElement(string key, string value) { _needsInit = true; _initKey = key; _initValue = value; } protected internal override void Init() { base.Init(); // We cannot initialize configuration properties in the constructor, // because Properties is an overridable virtual property that // hence may not be available in the constructor. if (_needsInit) { _needsInit = false; base[_propKey] = _initKey; Value = _initValue; } } // // Properties // [ConfigurationProperty("key", Options = ConfigurationPropertyOptions.IsKey, DefaultValue = "")] public string Key { get { return (string)base[_propKey]; } } [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. // //----------------------------------------------------------------------------- namespace System.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.IO; using System.Text; public class KeyValueConfigurationElement : ConfigurationElement { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propKey = new ConfigurationProperty("key", typeof(string), String.Empty, ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired); private static readonly ConfigurationProperty _propValue = new ConfigurationProperty("value", typeof(string), String.Empty, ConfigurationPropertyOptions.None); static KeyValueConfigurationElement() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propKey); _properties.Add(_propValue); } protected internal override ConfigurationPropertyCollection Properties { get { return _properties; } } bool _needsInit; string _initKey; string _initValue; // // Constructor // internal KeyValueConfigurationElement() { } public KeyValueConfigurationElement(string key, string value) { _needsInit = true; _initKey = key; _initValue = value; } protected internal override void Init() { base.Init(); // We cannot initialize configuration properties in the constructor, // because Properties is an overridable virtual property that // hence may not be available in the constructor. if (_needsInit) { _needsInit = false; base[_propKey] = _initKey; Value = _initValue; } } // // Properties // [ConfigurationProperty("key", Options = ConfigurationPropertyOptions.IsKey, DefaultValue = "")] public string Key { get { return (string)base[_propKey]; } } [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
- FileDialog_Vista.cs
- MemoryStream.cs
- AuthenticationConfig.cs
- Message.cs
- Axis.cs
- BrowsableAttribute.cs
- SelectedCellsCollection.cs
- AlphabeticalEnumConverter.cs
- DateTimeOffsetStorage.cs
- XPathSelfQuery.cs
- LinqDataSourceStatusEventArgs.cs
- AuthenticateEventArgs.cs
- VirtualPathProvider.cs
- ImageField.cs
- SetStateEventArgs.cs
- Profiler.cs
- RequestSecurityTokenResponse.cs
- CodePropertyReferenceExpression.cs
- BindingNavigatorDesigner.cs
- DesignerVerbToolStripMenuItem.cs
- MessageDescription.cs
- CodeCommentStatementCollection.cs
- Vector3dCollection.cs
- TextPointer.cs
- ClientCredentials.cs
- SupportsEventValidationAttribute.cs
- DocumentPageViewAutomationPeer.cs
- NotifyIcon.cs
- ResourceAttributes.cs
- SoapCodeExporter.cs
- SynchronizedDispatch.cs
- SolidColorBrush.cs
- ResourceCategoryAttribute.cs
- AutoSizeComboBox.cs
- ListBoxChrome.cs
- DebugHandleTracker.cs
- Filter.cs
- SplitterCancelEvent.cs
- BordersPage.cs
- ZipFileInfoCollection.cs
- ContentTextAutomationPeer.cs
- XamlBrushSerializer.cs
- UriSection.cs
- AccessibleObject.cs
- SizeKeyFrameCollection.cs
- WindowsStartMenu.cs
- BinaryObjectInfo.cs
- WebConvert.cs
- Attributes.cs
- SafeWaitHandle.cs
- DBNull.cs
- SiteMapSection.cs
- MasterPageParser.cs
- ReservationNotFoundException.cs
- UpdateException.cs
- XmlSerializationReader.cs
- PathGeometry.cs
- StackBuilderSink.cs
- FrameworkElementAutomationPeer.cs
- DataSourceView.cs
- GeometryValueSerializer.cs
- DiagnosticsConfiguration.cs
- QilExpression.cs
- TypeSystem.cs
- ProtocolsConfiguration.cs
- AmbientLight.cs
- RelatedEnd.cs
- VisualBasicExpressionConverter.cs
- XmlQueryContext.cs
- SqlConnection.cs
- PeerTransportListenAddressConverter.cs
- InstalledFontCollection.cs
- ClientBuildManager.cs
- DataTableCollection.cs
- WinCategoryAttribute.cs
- ClassHandlersStore.cs
- UserControlFileEditor.cs
- SuppressIldasmAttribute.cs
- ServiceModelConfigurationElementCollection.cs
- EditCommandColumn.cs
- DoubleCollectionConverter.cs
- BitArray.cs
- TextSegment.cs
- SrgsText.cs
- ConsoleEntryPoint.cs
- FieldNameLookup.cs
- OperationContextScope.cs
- BitmapVisualManager.cs
- FontStyles.cs
- UIElementHelper.cs
- userdatakeys.cs
- StatusBar.cs
- URLMembershipCondition.cs
- DataControlImageButton.cs
- FileAuthorizationModule.cs
- TypedDatasetGenerator.cs
- AccessDataSourceView.cs
- SchemaComplexType.cs
- SortQuery.cs
- Label.cs