Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / System / Diagnostics / TypedElement.cs / 1 / TypedElement.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Configuration; using System; using System.Reflection; using System.Globalization; namespace System.Diagnostics { internal class TypedElement : ConfigurationElement { protected static readonly ConfigurationProperty _propTypeName = new ConfigurationProperty("type", typeof(string), String.Empty, ConfigurationPropertyOptions.IsRequired); protected static readonly ConfigurationProperty _propInitData = new ConfigurationProperty("initializeData", typeof(string), String.Empty, ConfigurationPropertyOptions.None); protected ConfigurationPropertyCollection _properties; protected object _runtimeObject = null; private Type _baseType; public TypedElement(Type baseType) : base() { _properties = new ConfigurationPropertyCollection(); _properties.Add(_propTypeName); _properties.Add(_propInitData); _baseType = baseType; } [ConfigurationProperty("initializeData", DefaultValue = "")] public string InitData { get { return (string) this[_propInitData]; } // This is useful when the OM becomes public. In the meantime, this can be utilized via reflection set { this[_propInitData] = value; } } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("type", IsRequired = true, DefaultValue = "")] public virtual string TypeName { get { return (string) this[_propTypeName]; } set { this[_propTypeName] = value; } } protected object BaseGetRuntimeObject() { if (_runtimeObject == null) _runtimeObject = TraceUtils.GetRuntimeObject(TypeName, _baseType, InitData); return _runtimeObject; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System.Configuration; using System; using System.Reflection; using System.Globalization; namespace System.Diagnostics { internal class TypedElement : ConfigurationElement { protected static readonly ConfigurationProperty _propTypeName = new ConfigurationProperty("type", typeof(string), String.Empty, ConfigurationPropertyOptions.IsRequired); protected static readonly ConfigurationProperty _propInitData = new ConfigurationProperty("initializeData", typeof(string), String.Empty, ConfigurationPropertyOptions.None); protected ConfigurationPropertyCollection _properties; protected object _runtimeObject = null; private Type _baseType; public TypedElement(Type baseType) : base() { _properties = new ConfigurationPropertyCollection(); _properties.Add(_propTypeName); _properties.Add(_propInitData); _baseType = baseType; } [ConfigurationProperty("initializeData", DefaultValue = "")] public string InitData { get { return (string) this[_propInitData]; } // This is useful when the OM becomes public. In the meantime, this can be utilized via reflection set { this[_propInitData] = value; } } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("type", IsRequired = true, DefaultValue = "")] public virtual string TypeName { get { return (string) this[_propTypeName]; } set { this[_propTypeName] = value; } } protected object BaseGetRuntimeObject() { if (_runtimeObject == null) _runtimeObject = TraceUtils.GetRuntimeObject(TypeName, _baseType, InitData); return _runtimeObject; } } } // 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
- ListViewSelectEventArgs.cs
- JsonObjectDataContract.cs
- RSAOAEPKeyExchangeDeformatter.cs
- NameValueFileSectionHandler.cs
- FixUpCollection.cs
- TranslateTransform3D.cs
- UITypeEditor.cs
- RegistryDataKey.cs
- BackgroundFormatInfo.cs
- AspProxy.cs
- Int16Animation.cs
- cookiecollection.cs
- WindowsAltTab.cs
- control.ime.cs
- MethodBody.cs
- CryptoApi.cs
- CodeAccessPermission.cs
- ResourceReferenceExpression.cs
- WorkflowRuntimeBehavior.cs
- SyntaxCheck.cs
- BitmapEffect.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- NameObjectCollectionBase.cs
- ListViewItem.cs
- KnownTypes.cs
- ConfigurationStrings.cs
- UrlPropertyAttribute.cs
- SuppressMessageAttribute.cs
- ExtensionQuery.cs
- GPPOINTF.cs
- XmlSerializerFactory.cs
- SystemDropShadowChrome.cs
- DataControlPagerLinkButton.cs
- StateBag.cs
- BitmapSizeOptions.cs
- SelectionRange.cs
- DataGrid.cs
- ToolStripItemDataObject.cs
- DataGridViewTextBoxEditingControl.cs
- TypedTableBaseExtensions.cs
- DateTimeConstantAttribute.cs
- IUnknownConstantAttribute.cs
- formatstringdialog.cs
- ExpressionParser.cs
- TransformerConfigurationWizardBase.cs
- GeometryGroup.cs
- QuaternionRotation3D.cs
- KnownBoxes.cs
- XamlDesignerSerializationManager.cs
- ValueTypeFixupInfo.cs
- AccessorTable.cs
- SqlConnectionManager.cs
- KeyValuePairs.cs
- EntityProviderServices.cs
- CheckBoxStandardAdapter.cs
- AsyncStreamReader.cs
- TextDecorationUnitValidation.cs
- GlyphRunDrawing.cs
- CompareInfo.cs
- TraceContextRecord.cs
- SecurityListenerSettingsLifetimeManager.cs
- TreeViewImageKeyConverter.cs
- RightsManagementPermission.cs
- _SafeNetHandles.cs
- BaseUriHelper.cs
- SettingsProviderCollection.cs
- DataTableClearEvent.cs
- KeyEvent.cs
- Int16.cs
- Logging.cs
- XmlILStorageConverter.cs
- EntityClientCacheEntry.cs
- OdbcReferenceCollection.cs
- RemotingConfigParser.cs
- NativeMethodsOther.cs
- EntryPointNotFoundException.cs
- ParameterBuilder.cs
- TextUtf8RawTextWriter.cs
- EventSinkHelperWriter.cs
- Pair.cs
- VisualCollection.cs
- linebase.cs
- ValidatorCollection.cs
- PseudoWebRequest.cs
- ParenExpr.cs
- ConversionContext.cs
- TemplateFactory.cs
- HttpInputStream.cs
- RandomNumberGenerator.cs
- SerializationAttributes.cs
- Int32CAMarshaler.cs
- AdornerLayer.cs
- BroadcastEventHelper.cs
- EntityDataSourceWrapperCollection.cs
- OptimalBreakSession.cs
- NullableDecimalMinMaxAggregationOperator.cs
- FontCacheUtil.cs
- DataListItemEventArgs.cs
- LinearQuaternionKeyFrame.cs
- CapabilitiesState.cs