Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- NavigateUrlConverter.cs
- _ProxyChain.cs
- ReadWriteSpinLock.cs
- Int64AnimationBase.cs
- XmlStreamStore.cs
- XmlSerializerFactory.cs
- EmbossBitmapEffect.cs
- SettingsProviderCollection.cs
- XmlSchemaSimpleTypeUnion.cs
- configsystem.cs
- CounterSetInstance.cs
- Clipboard.cs
- DigitShape.cs
- PrivateFontCollection.cs
- ObjectDataSourceDisposingEventArgs.cs
- PageBuildProvider.cs
- Interlocked.cs
- IntranetCredentialPolicy.cs
- InternalTypeHelper.cs
- _ScatterGatherBuffers.cs
- Pair.cs
- Viewport2DVisual3D.cs
- EditorPart.cs
- StylusPointPropertyInfo.cs
- StronglyTypedResourceBuilder.cs
- XmlDocument.cs
- ObjectDataSourceFilteringEventArgs.cs
- EditorPartChrome.cs
- SqlConnectionPoolGroupProviderInfo.cs
- SerializerDescriptor.cs
- BoundField.cs
- OTFRasterizer.cs
- ISSmlParser.cs
- InputLangChangeRequestEvent.cs
- DataControlFieldHeaderCell.cs
- ErrorTableItemStyle.cs
- UriGenerator.cs
- SafeRightsManagementHandle.cs
- EventTrigger.cs
- AttributeCollection.cs
- PageCodeDomTreeGenerator.cs
- DataGridViewSelectedCellCollection.cs
- TransactionChannelFaultConverter.cs
- NetworkCredential.cs
- DiscoveryClientReferences.cs
- ValueUtilsSmi.cs
- StringUtil.cs
- CounterSampleCalculator.cs
- DictionaryBase.cs
- WebPartMenuStyle.cs
- Propagator.cs
- SelectorAutomationPeer.cs
- VectorCollectionValueSerializer.cs
- CollectionExtensions.cs
- Clause.cs
- ResourceDictionary.cs
- JavaScriptString.cs
- PropertyBuilder.cs
- Binding.cs
- GACMembershipCondition.cs
- MobileControlBuilder.cs
- ModelItemImpl.cs
- LogWriteRestartAreaAsyncResult.cs
- DataServiceQuery.cs
- CodeIdentifier.cs
- SettingsPropertyWrongTypeException.cs
- FixedTextView.cs
- latinshape.cs
- Evidence.cs
- ActivityDesignerLayoutSerializers.cs
- ToolStripItemCollection.cs
- ByteAnimationUsingKeyFrames.cs
- PtsHelper.cs
- CodePrimitiveExpression.cs
- InputReferenceExpression.cs
- ContentDisposition.cs
- GridItemProviderWrapper.cs
- GlobalizationSection.cs
- DecimalAnimationUsingKeyFrames.cs
- LogRestartAreaEnumerator.cs
- XmlUnspecifiedAttribute.cs
- WSUtilitySpecificationVersion.cs
- DebuggerAttributes.cs
- ToolStripItemImageRenderEventArgs.cs
- CompilerLocalReference.cs
- HtmlInputFile.cs
- activationcontext.cs
- DescendentsWalker.cs
- XmlParserContext.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- Storyboard.cs
- BrowserCapabilitiesFactory35.cs
- SecurityTokenTypes.cs
- XmlElement.cs
- LayoutEditorPart.cs
- LiteralTextContainerControlBuilder.cs
- SmtpSection.cs
- XmlCharacterData.cs
- UrlMapping.cs
- ClientRolePrincipal.cs