Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / DeferredReference.cs / 1305600 / 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
- SecurityContextSecurityTokenAuthenticator.cs
- MeasurementDCInfo.cs
- XmlSchemaGroupRef.cs
- SafeBitVector32.cs
- XhtmlTextWriter.cs
- Mutex.cs
- ToolStripArrowRenderEventArgs.cs
- WindowsAuthenticationModule.cs
- FolderBrowserDialog.cs
- SpecialFolderEnumConverter.cs
- OracleString.cs
- SecurityManager.cs
- DataRowCollection.cs
- DataRowCollection.cs
- DnsPermission.cs
- ListControlStringCollectionEditor.cs
- TriggerAction.cs
- XmlAnyElementAttribute.cs
- BinaryNode.cs
- XmlSchemaType.cs
- XmlSchemaComplexContentRestriction.cs
- Rectangle.cs
- ModelTreeEnumerator.cs
- TableRow.cs
- CompilerGeneratedAttribute.cs
- WebSysDisplayNameAttribute.cs
- HtmlElementErrorEventArgs.cs
- GradientBrush.cs
- DurableTimerExtension.cs
- PerformanceCounter.cs
- parserscommon.cs
- Hashtable.cs
- TextSpan.cs
- TripleDESCryptoServiceProvider.cs
- OracleException.cs
- DeploymentSection.cs
- PkcsMisc.cs
- ContentPosition.cs
- DataMemberFieldConverter.cs
- ImagingCache.cs
- Int64AnimationUsingKeyFrames.cs
- InitializingNewItemEventArgs.cs
- SQLBoolean.cs
- TablePatternIdentifiers.cs
- Point3D.cs
- ImageSource.cs
- FtpCachePolicyElement.cs
- LicenseProviderAttribute.cs
- TextFormatterContext.cs
- HttpGetProtocolReflector.cs
- XdrBuilder.cs
- Transform3D.cs
- DataPager.cs
- FontClient.cs
- HierarchicalDataBoundControlAdapter.cs
- SqlUdtInfo.cs
- KeyToListMap.cs
- Visual3D.cs
- Icon.cs
- ConfigurationLocation.cs
- Sentence.cs
- DataGridItemEventArgs.cs
- Pointer.cs
- TypefaceCollection.cs
- TypeUtil.cs
- IssuedTokensHeader.cs
- ReflectionHelper.cs
- XmlEncoding.cs
- BindingSource.cs
- CustomCategoryAttribute.cs
- TreeNodeSelectionProcessor.cs
- Quaternion.cs
- XmlWriterSettings.cs
- ValueConversionAttribute.cs
- ScriptingSectionGroup.cs
- HtmlUtf8RawTextWriter.cs
- FontDialog.cs
- Compensation.cs
- PopupRoot.cs
- HtmlInputHidden.cs
- TraceRecord.cs
- ConnectionManagementElementCollection.cs
- SqlUtils.cs
- VisualProxy.cs
- LOSFormatter.cs
- SignedXml.cs
- FloaterBaseParagraph.cs
- NameValueConfigurationCollection.cs
- SqlNamer.cs
- SpeakCompletedEventArgs.cs
- safex509handles.cs
- ColorMap.cs
- CodeValidator.cs
- WebRequestModulesSection.cs
- BridgeDataRecord.cs
- FormViewCommandEventArgs.cs
- TextUtf8RawTextWriter.cs
- ToolStripDropDownClosingEventArgs.cs
- SqlServer2KCompatibilityCheck.cs
- SqlDataSourceCache.cs