Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / System / Windows / DeferredReference.cs / 1 / DeferredReference.cs
//---------------------------------------------------------------------------- // // File: DeferredReference.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Proxy object passed to the property system to delay load values. // //--------------------------------------------------------------------------- namespace System.Windows { using MS.Internal.WindowsBase; // FriendAccessAllowed // Proxy object passed to the property system to delay load values. // // The property system will make a GetValue callback (dereferencing the // reference) inside DependencyProperty.GetValue calls, or before // coercion callbacks to derived classes. // // DeferredReference instances are passed directly to ValidateValue // callbacks (which always go to the DependencyProperty owner class), // and also to CoerceValue callbacks on the owner class only. THEREFORE, // IT IS [FriendAccessAllowed] // Built into Base, also used by Core & Framework. internal abstract class DeferredReference { //----------------------------------------------------- // // Internal Methods // //----------------------------------------------------- #region Internal Methods // Deferences a property value on demand. internal abstract object GetValue(BaseValueSourceInternal valueSource); // Gets the type of the value it represents internal abstract Type GetValueType(); #endregion Internal Methods } internal class DeferredMutableDefaultReference : DeferredReference { #region Constructor internal DeferredMutableDefaultReference(PropertyMetadata metadata, DependencyObject d, DependencyProperty dp) { _sourceObject = d; _sourceProperty = dp; _sourceMetadata = metadata; } #endregion Constructor #region Methods internal override object GetValue(BaseValueSourceInternal valueSource) { return _sourceMetadata.GetDefaultValue(_sourceObject, _sourceProperty); } // Gets the type of the value it represents internal override Type GetValueType() { return _sourceProperty.PropertyType; } #endregion Methods #region Properties internal PropertyMetadata SourceMetadata { get { return _sourceMetadata; } } protected DependencyObject SourceObject { get { return _sourceObject; } } protected DependencyProperty SourceProperty { get { return _sourceProperty; } } #endregion Properties #region Data private readonly PropertyMetadata _sourceMetadata; private readonly DependencyObject _sourceObject; private readonly DependencyProperty _sourceProperty; #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ValidatorCollection.cs
- Facet.cs
- Parser.cs
- Control.cs
- IncrementalReadDecoders.cs
- RoleGroupCollection.cs
- DataGridViewCellLinkedList.cs
- SyndicationSerializer.cs
- XmlCharCheckingWriter.cs
- ConnectorMovedEventArgs.cs
- TypeConverterAttribute.cs
- RoleBoolean.cs
- Literal.cs
- ApplicationDirectoryMembershipCondition.cs
- WebBaseEventKeyComparer.cs
- LinkArea.cs
- ConnectionStringSettings.cs
- Page.cs
- ToolStripDesigner.cs
- _SslStream.cs
- Preprocessor.cs
- HtmlInputSubmit.cs
- EncoderFallback.cs
- ProtectedProviderSettings.cs
- MetadataCache.cs
- ProgressPage.cs
- BindMarkupExtensionSerializer.cs
- ConditionChanges.cs
- TransformerConfigurationWizardBase.cs
- VisualStateManager.cs
- GlobalizationAssembly.cs
- RenderContext.cs
- ContextQuery.cs
- SharedPerformanceCounter.cs
- ChangesetResponse.cs
- ObjectDataSourceDisposingEventArgs.cs
- GridView.cs
- __ComObject.cs
- WebPartEditorOkVerb.cs
- TagPrefixAttribute.cs
- CrossAppDomainChannel.cs
- Utils.cs
- RequestDescription.cs
- SizeAnimationBase.cs
- UInt16Converter.cs
- PageFunction.cs
- wgx_render.cs
- CodeBlockBuilder.cs
- Attributes.cs
- GridView.cs
- SessionSwitchEventArgs.cs
- FileDialogCustomPlacesCollection.cs
- OperatorExpressions.cs
- StoreAnnotationsMap.cs
- MetadataCache.cs
- SevenBitStream.cs
- HtmlTableCell.cs
- ViewGenResults.cs
- FormDesigner.cs
- BooleanStorage.cs
- Zone.cs
- VectorValueSerializer.cs
- SqlRemoveConstantOrderBy.cs
- TextServicesCompartmentEventSink.cs
- BaseTemplateCodeDomTreeGenerator.cs
- KeyedCollection.cs
- UnsafeNetInfoNativeMethods.cs
- DataGridViewRowPostPaintEventArgs.cs
- Span.cs
- RuntimeResourceSet.cs
- EmptyEnumerator.cs
- RunWorkerCompletedEventArgs.cs
- ProvideValueServiceProvider.cs
- ValidatingReaderNodeData.cs
- DbDataAdapter.cs
- FieldBuilder.cs
- CompositeControl.cs
- SqlNodeTypeOperators.cs
- TreePrinter.cs
- DBSchemaTable.cs
- PagesSection.cs
- CalendarAutoFormat.cs
- CustomErrorCollection.cs
- FilePrompt.cs
- TableLayoutSettingsTypeConverter.cs
- ECDiffieHellmanCngPublicKey.cs
- LineSegment.cs
- SoapAttributeAttribute.cs
- ClientScriptManager.cs
- Binding.cs
- DataGridViewColumnHeaderCell.cs
- RectAnimationClockResource.cs
- OdbcError.cs
- ConfigurationValue.cs
- CmsInterop.cs
- ProviderCollection.cs
- namescope.cs
- BidOverLoads.cs
- HttpResponseHeader.cs
- GetPageCompletedEventArgs.cs