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
- TypeConverterHelper.cs
- XmlToDatasetMap.cs
- precedingquery.cs
- TypedDataSetSchemaImporterExtensionFx35.cs
- ScaleTransform3D.cs
- Application.cs
- HttpCapabilitiesSectionHandler.cs
- AnnotationComponentChooser.cs
- iisPickupDirectory.cs
- KeyFrames.cs
- InplaceBitmapMetadataWriter.cs
- Ports.cs
- cache.cs
- BitmapSizeOptions.cs
- HttpProfileBase.cs
- WindowsListBox.cs
- ScrollChangedEventArgs.cs
- TargetFrameworkAttribute.cs
- FrameworkElement.cs
- HtmlInputHidden.cs
- SelectorAutomationPeer.cs
- XmlSignificantWhitespace.cs
- TokenizerHelper.cs
- HebrewNumber.cs
- AmbientLight.cs
- CaseInsensitiveComparer.cs
- DataServiceQuery.cs
- IPCCacheManager.cs
- _UncName.cs
- Light.cs
- ProcessManager.cs
- MergePropertyDescriptor.cs
- MinMaxParagraphWidth.cs
- PathFigureCollection.cs
- Misc.cs
- GcSettings.cs
- FieldMetadata.cs
- _BasicClient.cs
- TimeIntervalCollection.cs
- InputLangChangeEvent.cs
- FileCodeGroup.cs
- TextInfo.cs
- ByteAnimationUsingKeyFrames.cs
- TraceHwndHost.cs
- XPathDocumentBuilder.cs
- DocumentApplicationJournalEntry.cs
- WebServiceHandlerFactory.cs
- DataServiceExpressionVisitor.cs
- EncoderBestFitFallback.cs
- storepermissionattribute.cs
- AuthorizationRuleCollection.cs
- baseshape.cs
- XmlReflectionMember.cs
- DataRowCollection.cs
- SmiMetaDataProperty.cs
- HttpModulesInstallComponent.cs
- DebugInfo.cs
- EntitySetBaseCollection.cs
- Activator.cs
- NegotiateStream.cs
- HttpHandlersInstallComponent.cs
- TextRangeSerialization.cs
- AutoResizedEvent.cs
- CompModHelpers.cs
- HttpModulesSection.cs
- ContractCodeDomInfo.cs
- GridViewHeaderRowPresenter.cs
- ResourcePart.cs
- HuffmanTree.cs
- DbRetry.cs
- EngineSite.cs
- GridEntry.cs
- DbConnectionPoolGroupProviderInfo.cs
- SortedDictionary.cs
- CommandSet.cs
- CompiledAction.cs
- PageRequestManager.cs
- DateTimeConverter2.cs
- DataGridViewRowStateChangedEventArgs.cs
- AssociationTypeEmitter.cs
- SqlGenericUtil.cs
- HttpStreamMessage.cs
- HandlerBase.cs
- RangeContentEnumerator.cs
- Type.cs
- SubstitutionResponseElement.cs
- SoapReflector.cs
- PerfCounterSection.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- Codec.cs
- XmlEnumAttribute.cs
- WebColorConverter.cs
- EllipseGeometry.cs
- ControlAdapter.cs
- CodeConstructor.cs
- CallbackDebugElement.cs
- SafeEventLogWriteHandle.cs
- OutputWindow.cs
- WebPartAuthorizationEventArgs.cs
- SqlUtil.cs