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
- TableRowGroup.cs
- ContainsRowNumberChecker.cs
- MethodImplAttribute.cs
- versioninfo.cs
- RectAnimationClockResource.cs
- InfoCardListRequest.cs
- GZipDecoder.cs
- ParagraphResult.cs
- ResourceExpression.cs
- CommandBinding.cs
- Tuple.cs
- COM2Enum.cs
- HWStack.cs
- Typography.cs
- PKCS1MaskGenerationMethod.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- ICspAsymmetricAlgorithm.cs
- _HelperAsyncResults.cs
- InputScopeAttribute.cs
- PathNode.cs
- CompositeTypefaceMetrics.cs
- SqlPersonalizationProvider.cs
- WindowsListView.cs
- ValidationEventArgs.cs
- RequestResponse.cs
- ItemList.cs
- PerformanceCounterManager.cs
- FixedFlowMap.cs
- StorageMappingFragment.cs
- NetCodeGroup.cs
- Label.cs
- AdapterDictionary.cs
- List.cs
- SizeLimitedCache.cs
- BrushConverter.cs
- SoapAttributeOverrides.cs
- XmlILModule.cs
- FileAuthorizationModule.cs
- XmlWellformedWriter.cs
- ItemCheckedEvent.cs
- PrinterSettings.cs
- DataGridViewCellCollection.cs
- BaseValidatorDesigner.cs
- XhtmlTextWriter.cs
- CheckBoxDesigner.cs
- EdmProperty.cs
- Hashtable.cs
- ModifierKeysValueSerializer.cs
- CardSpacePolicyElement.cs
- DisableDpiAwarenessAttribute.cs
- RuleProcessor.cs
- UxThemeWrapper.cs
- StackBuilderSink.cs
- SchemaNotation.cs
- HttpRuntime.cs
- HttpHeaderCollection.cs
- ConfigurationManagerHelper.cs
- SemanticResultValue.cs
- DBSchemaTable.cs
- ButtonStandardAdapter.cs
- ScriptingProfileServiceSection.cs
- GZipStream.cs
- mediaclock.cs
- ReadOnlyDictionary.cs
- ToolStripItemCollection.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- HandlerMappingMemo.cs
- FontStyles.cs
- DataContractSerializerElement.cs
- DateTimeStorage.cs
- BigInt.cs
- DataGridViewTextBoxCell.cs
- RootAction.cs
- AppSettingsSection.cs
- PathParser.cs
- ObjectItemConventionAssemblyLoader.cs
- ProxyGenerationError.cs
- ConfigXmlComment.cs
- _AutoWebProxyScriptHelper.cs
- SectionVisual.cs
- TextBoxAutomationPeer.cs
- WindowsSecurityTokenAuthenticator.cs
- ControlIdConverter.cs
- HttpRequestCacheValidator.cs
- Metafile.cs
- GridErrorDlg.cs
- TextElementEnumerator.cs
- ProviderIncompatibleException.cs
- dataSvcMapFileLoader.cs
- TableCellAutomationPeer.cs
- SecurityCriticalDataForSet.cs
- _Events.cs
- StyleSheetDesigner.cs
- XmlTextAttribute.cs
- TagNameToTypeMapper.cs
- SqlConnectionManager.cs
- ReadOnlyDictionary.cs
- XsltArgumentList.cs
- HtmlHistory.cs
- RootCodeDomSerializer.cs