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
- PackagePart.cs
- SecurityContext.cs
- ContainerVisual.cs
- FontCollection.cs
- PasswordBoxAutomationPeer.cs
- XmlChildEnumerator.cs
- PeerNodeTraceRecord.cs
- ImageAttributes.cs
- ClientBase.cs
- ThemeableAttribute.cs
- WindowManager.cs
- TextEditorCopyPaste.cs
- DesignSurfaceServiceContainer.cs
- ZipArchive.cs
- NopReturnReader.cs
- TrustManagerMoreInformation.cs
- Underline.cs
- Setter.cs
- Int64AnimationBase.cs
- HttpFileCollection.cs
- SafeNativeMethods.cs
- MissingManifestResourceException.cs
- MaskedTextProvider.cs
- StyleSheet.cs
- SqlNamer.cs
- InkSerializer.cs
- RoutedEventValueSerializer.cs
- SystemColors.cs
- DataGridPagingPage.cs
- RenderDataDrawingContext.cs
- BatchParser.cs
- BinaryMessageEncodingBindingElement.cs
- IndentedWriter.cs
- DataObjectPastingEventArgs.cs
- SortExpressionBuilder.cs
- FrameworkContentElement.cs
- Atom10FormatterFactory.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- TextBlockAutomationPeer.cs
- AsyncPostBackErrorEventArgs.cs
- ConstraintEnumerator.cs
- PackWebRequest.cs
- Encoder.cs
- SqlDataSourceConnectionPanel.cs
- SystemColors.cs
- JournalNavigationScope.cs
- TreeSet.cs
- AuthenticationManager.cs
- Char.cs
- CommandCollectionEditor.cs
- LookupBindingPropertiesAttribute.cs
- WindowsAuthenticationEventArgs.cs
- TransformationRules.cs
- CompilerGeneratedAttribute.cs
- Int32Storage.cs
- ReachDocumentReferenceCollectionSerializer.cs
- DocumentGrid.cs
- SoapInteropTypes.cs
- XPathNavigatorReader.cs
- WorkItem.cs
- DragSelectionMessageFilter.cs
- UIElementHelper.cs
- ProgressPage.cs
- SizeAnimation.cs
- DocumentApplicationState.cs
- HashHelper.cs
- Queue.cs
- QueryOperationResponseOfT.cs
- ConfigurationStrings.cs
- TextEditorMouse.cs
- IdentityVerifier.cs
- WorkflowInvoker.cs
- Rule.cs
- AdRotator.cs
- SQLInt32Storage.cs
- WindowsFormsHelpers.cs
- ViewCellSlot.cs
- ObjectReaderCompiler.cs
- SecurityTokenSerializer.cs
- TcpAppDomainProtocolHandler.cs
- CompilerState.cs
- RC2CryptoServiceProvider.cs
- OutputScope.cs
- TextPointerBase.cs
- DNS.cs
- PropertyIdentifier.cs
- TextFragmentEngine.cs
- HighContrastHelper.cs
- Brushes.cs
- ProxyHelper.cs
- WindowsListViewGroup.cs
- HttpHandlerActionCollection.cs
- precedingquery.cs
- DeobfuscatingStream.cs
- GetPageNumberCompletedEventArgs.cs
- TrackingServices.cs
- TextBoxBase.cs
- ErrorView.xaml.cs
- BamlTreeNode.cs
- UdpUtility.cs