Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- EventEntry.cs
- DataKeyCollection.cs
- PeerNearMe.cs
- PageCache.cs
- WebBrowserHelper.cs
- XmlSchemaProviderAttribute.cs
- ComPlusSynchronizationContext.cs
- HwndSourceKeyboardInputSite.cs
- WsdlInspector.cs
- TextStore.cs
- Point3D.cs
- WebEventCodes.cs
- ManagementObject.cs
- ParentQuery.cs
- XamlClipboardData.cs
- SqlRecordBuffer.cs
- SiteMapNodeItem.cs
- CommandEventArgs.cs
- MaskedTextBoxDesignerActionList.cs
- WebSysDescriptionAttribute.cs
- BufferBuilder.cs
- CollectionAdapters.cs
- WebServiceHostFactory.cs
- CodeGenHelper.cs
- ParenthesizePropertyNameAttribute.cs
- XmlWrappingWriter.cs
- HMACMD5.cs
- UrlPath.cs
- NavigationPropertyEmitter.cs
- WebPartsSection.cs
- ColorConvertedBitmap.cs
- PrimitiveType.cs
- TransformedBitmap.cs
- DataGridColumnCollection.cs
- ControlCachePolicy.cs
- Table.cs
- _TransmitFileOverlappedAsyncResult.cs
- TripleDES.cs
- ArrangedElement.cs
- DataListCommandEventArgs.cs
- DesignTimeDataBinding.cs
- WebEventTraceProvider.cs
- DispatchChannelSink.cs
- InputLanguageEventArgs.cs
- DirectoryInfo.cs
- ExpressionCopier.cs
- CssTextWriter.cs
- PointConverter.cs
- TextTreeObjectNode.cs
- SizeF.cs
- SecurityTokenProvider.cs
- X509CertificateStore.cs
- PropertyGridEditorPart.cs
- SqlCommandSet.cs
- DiscardableAttribute.cs
- SurrogateEncoder.cs
- PageAdapter.cs
- Activity.cs
- DbProviderFactory.cs
- DataGridViewRowPostPaintEventArgs.cs
- _ContextAwareResult.cs
- TextWriter.cs
- SinglePageViewer.cs
- Solver.cs
- DataListCommandEventArgs.cs
- DataGridDesigner.cs
- EventItfInfo.cs
- SessionIDManager.cs
- PassportPrincipal.cs
- MapPathBasedVirtualPathProvider.cs
- EventMappingSettings.cs
- IndicShape.cs
- WebPartDisplayModeEventArgs.cs
- ColumnReorderedEventArgs.cs
- ErrorWrapper.cs
- RegexCompiler.cs
- Baml2006KnownTypes.cs
- DecoderExceptionFallback.cs
- LabelEditEvent.cs
- SchemaEntity.cs
- webeventbuffer.cs
- ListViewInsertEventArgs.cs
- DbConnectionStringCommon.cs
- TrackingQueryElement.cs
- SByteStorage.cs
- TransformValueSerializer.cs
- Visitors.cs
- GridViewCancelEditEventArgs.cs
- DataError.cs
- XmlSigningNodeWriter.cs
- SafeWaitHandle.cs
- EventToken.cs
- SqlClientFactory.cs
- BlobPersonalizationState.cs
- Tracer.cs
- FaultImportOptions.cs
- DateTimeUtil.cs
- wmiprovider.cs
- XmlDocumentSerializer.cs
- Timeline.cs