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
- ToolStripItemImageRenderEventArgs.cs
- Tuple.cs
- MimeFormatExtensions.cs
- EventHandlingScope.cs
- LoginViewDesigner.cs
- ConsumerConnectionPointCollection.cs
- dbdatarecord.cs
- AddInBase.cs
- OleDbWrapper.cs
- ContainerUIElement3D.cs
- HeaderedItemsControl.cs
- InvalidComObjectException.cs
- BitmapEffectGeneralTransform.cs
- ChangeBlockUndoRecord.cs
- SqlGatherConsumedAliases.cs
- WindowsStatusBar.cs
- DataColumnCollection.cs
- NumberFormatInfo.cs
- ConsumerConnectionPoint.cs
- BuildProviderAppliesToAttribute.cs
- SignatureResourceHelper.cs
- Rijndael.cs
- StorageMappingItemLoader.cs
- HMAC.cs
- ActivityInterfaces.cs
- InputLanguageCollection.cs
- XsltCompileContext.cs
- BidOverLoads.cs
- SwitchAttribute.cs
- Parameter.cs
- CacheEntry.cs
- CompiledIdentityConstraint.cs
- CompilerGlobalScopeAttribute.cs
- HttpRuntime.cs
- IdentityVerifier.cs
- KnownIds.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- DocumentViewerBase.cs
- UnknownWrapper.cs
- DesignerCategoryAttribute.cs
- DesignerToolboxInfo.cs
- JpegBitmapDecoder.cs
- FindRequestContext.cs
- DelegatedStream.cs
- Int64AnimationUsingKeyFrames.cs
- PackagingUtilities.cs
- bidPrivateBase.cs
- CaseStatement.cs
- LeaseManager.cs
- exports.cs
- PrintPreviewControl.cs
- DbConnectionPoolGroupProviderInfo.cs
- ReflectionPermission.cs
- ProfileGroupSettingsCollection.cs
- TransactionFlowOption.cs
- FileLevelControlBuilderAttribute.cs
- EntityDataSourceWrapper.cs
- oledbmetadatacolumnnames.cs
- WebPartConnection.cs
- NavigatorOutput.cs
- ColorConverter.cs
- figurelength.cs
- BitmapCodecInfo.cs
- ProfilePropertySettings.cs
- CharKeyFrameCollection.cs
- Validator.cs
- TextCollapsingProperties.cs
- ProcessStartInfo.cs
- ScrollItemProviderWrapper.cs
- AsyncInvokeOperation.cs
- InternalRelationshipCollection.cs
- FeatureManager.cs
- FixedSOMPage.cs
- SafeFindHandle.cs
- SelectorAutomationPeer.cs
- CompilerTypeWithParams.cs
- TextDecorationCollectionConverter.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- Rectangle.cs
- FrameworkElementFactory.cs
- MissingManifestResourceException.cs
- AnimationClockResource.cs
- MachineKeyValidationConverter.cs
- TypeElement.cs
- QuaternionAnimationBase.cs
- MSAANativeProvider.cs
- ObjectDataSourceEventArgs.cs
- SafeFileMapViewHandle.cs
- HtmlInputPassword.cs
- FileDialogPermission.cs
- processwaithandle.cs
- SwitchLevelAttribute.cs
- DataTemplate.cs
- DbDataSourceEnumerator.cs
- MenuItemStyleCollectionEditor.cs
- HtmlLinkAdapter.cs
- CodeValidator.cs
- EntityClassGenerator.cs
- CodeEventReferenceExpression.cs
- DomNameTable.cs