Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- AppDomainGrammarProxy.cs
- GenericEnumConverter.cs
- Wizard.cs
- ViewManager.cs
- CodeTypeReference.cs
- SqlOuterApplyReducer.cs
- CodeNamespaceImport.cs
- ModifiableIteratorCollection.cs
- RequiredAttributeAttribute.cs
- AnimatedTypeHelpers.cs
- GenericWebPart.cs
- GetWinFXPath.cs
- SoapBinding.cs
- _NTAuthentication.cs
- EventManager.cs
- MarshalByValueComponent.cs
- RadialGradientBrush.cs
- RoutedEventConverter.cs
- XamlTreeBuilderBamlRecordWriter.cs
- PtsContext.cs
- EntityDescriptor.cs
- LongMinMaxAggregationOperator.cs
- DetailsViewUpdatedEventArgs.cs
- SerializationStore.cs
- WebConvert.cs
- RtfNavigator.cs
- Tool.cs
- MultipartContentParser.cs
- ipaddressinformationcollection.cs
- DictionaryContent.cs
- TiffBitmapDecoder.cs
- DataReaderContainer.cs
- CreateDataSourceDialog.cs
- XmlDomTextWriter.cs
- StringOutput.cs
- Permission.cs
- UnsupportedPolicyOptionsException.cs
- WebScriptEnablingBehavior.cs
- WebPart.cs
- TransformPatternIdentifiers.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- PasswordRecovery.cs
- FormParameter.cs
- DefinitionBase.cs
- DPTypeDescriptorContext.cs
- Dictionary.cs
- SecuritySessionClientSettings.cs
- SqlClientMetaDataCollectionNames.cs
- GridItemPatternIdentifiers.cs
- Symbol.cs
- CompletionCallbackWrapper.cs
- PointHitTestResult.cs
- CodeCommentStatementCollection.cs
- ChangeProcessor.cs
- TypeToken.cs
- Path.cs
- ToolboxItemFilterAttribute.cs
- WaitHandleCannotBeOpenedException.cs
- _WinHttpWebProxyDataBuilder.cs
- x509store.cs
- SoapIgnoreAttribute.cs
- DescendentsWalkerBase.cs
- WebServiceClientProxyGenerator.cs
- NavigateUrlConverter.cs
- TagMapCollection.cs
- SubtreeProcessor.cs
- Html32TextWriter.cs
- HostingEnvironmentSection.cs
- XsltException.cs
- XmlWhitespace.cs
- IntSecurity.cs
- BaseConfigurationRecord.cs
- XmlHierarchicalDataSourceView.cs
- IOThreadScheduler.cs
- ChildTable.cs
- CodeMethodMap.cs
- BinaryObjectInfo.cs
- SimpleWorkerRequest.cs
- RawKeyboardInputReport.cs
- ConstrainedDataObject.cs
- DBDataPermission.cs
- HttpAsyncResult.cs
- ClientSession.cs
- MsmqTransportBindingElement.cs
- DependencyPropertyValueSerializer.cs
- DesignerForm.cs
- KnownTypesProvider.cs
- Pair.cs
- DocumentReferenceCollection.cs
- DataControlFieldCollection.cs
- Flattener.cs
- TextWriter.cs
- xmlsaver.cs
- RtfControls.cs
- XmlAttribute.cs
- TileModeValidation.cs
- BounceEase.cs
- ProviderSettingsCollection.cs
- WindowsListBox.cs
- EnumDataContract.cs