Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / 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. //---------------------------------------------------------------------------- // // 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
- VisualStates.cs
- GraphicsContext.cs
- ResXDataNode.cs
- SafeMILHandle.cs
- ModuleBuilderData.cs
- SHA256.cs
- ScriptHandlerFactory.cs
- DesignerHierarchicalDataSourceView.cs
- NotCondition.cs
- DesignerVerb.cs
- DebugView.cs
- unsafeIndexingFilterStream.cs
- GridViewEditEventArgs.cs
- EndSelectCardRequest.cs
- Baml2006SchemaContext.cs
- PixelFormatConverter.cs
- FileDialog.cs
- CqlGenerator.cs
- SettingsPropertyIsReadOnlyException.cs
- Pair.cs
- RootBrowserWindowProxy.cs
- RepeatInfo.cs
- HtmlLiteralTextAdapter.cs
- XmlSchemaIdentityConstraint.cs
- OutputCacheSettingsSection.cs
- AggregationMinMaxHelpers.cs
- CaretElement.cs
- SizeF.cs
- EventLogPermissionEntryCollection.cs
- HierarchicalDataSourceDesigner.cs
- ApplicationSettingsBase.cs
- TogglePattern.cs
- LayoutEvent.cs
- DataRowView.cs
- TrackingProfileCache.cs
- HelpEvent.cs
- SecUtil.cs
- _CookieModule.cs
- MenuItemBindingCollection.cs
- LabelAutomationPeer.cs
- NativeObjectSecurity.cs
- MsmqUri.cs
- StringDictionary.cs
- PieceNameHelper.cs
- ReachDocumentSequenceSerializerAsync.cs
- ObjectItemCollection.cs
- SpeakProgressEventArgs.cs
- SingleObjectCollection.cs
- SelectionWordBreaker.cs
- BaseResourcesBuildProvider.cs
- CalloutQueueItem.cs
- EntityDataSourceContextCreatedEventArgs.cs
- EntityDataSourceReferenceGroup.cs
- DbConnectionInternal.cs
- FlowDocumentPageViewerAutomationPeer.cs
- FixedTextView.cs
- HitTestParameters3D.cs
- DeviceContexts.cs
- RSAOAEPKeyExchangeFormatter.cs
- infer.cs
- LookupBindingPropertiesAttribute.cs
- IRCollection.cs
- ValidationPropertyAttribute.cs
- BaseContextMenu.cs
- ClientSession.cs
- TextFindEngine.cs
- ImageInfo.cs
- InstanceHandleReference.cs
- EditorBrowsableAttribute.cs
- SqlDataRecord.cs
- UnmanagedHandle.cs
- DetailsViewCommandEventArgs.cs
- WebBrowserProgressChangedEventHandler.cs
- ArraySortHelper.cs
- XmlRawWriter.cs
- GetPageCompletedEventArgs.cs
- ReadWriteObjectLock.cs
- SqlBooleanizer.cs
- complextypematerializer.cs
- ExpressionWriter.cs
- MappingException.cs
- AsynchronousChannelMergeEnumerator.cs
- XmlnsCompatibleWithAttribute.cs
- OptimalTextSource.cs
- HttpApplicationStateWrapper.cs
- QueryableDataSourceEditData.cs
- JoinGraph.cs
- DataGridColumnHeader.cs
- PointLightBase.cs
- MSAAWinEventWrap.cs
- TextContainer.cs
- DbgUtil.cs
- SecurityRequiresReviewAttribute.cs
- AnonymousIdentificationSection.cs
- SmiMetaData.cs
- TextStore.cs
- HostSecurityManager.cs
- AnimationLayer.cs
- BindingSource.cs
- SafeLibraryHandle.cs