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
- QilXmlReader.cs
- SoapTransportImporter.cs
- StackBuilderSink.cs
- EncodingInfo.cs
- ExpressionNode.cs
- PassportAuthenticationModule.cs
- _BufferOffsetSize.cs
- SizeValueSerializer.cs
- XmlAnyAttributeAttribute.cs
- RC2CryptoServiceProvider.cs
- BezierSegment.cs
- SqlInternalConnection.cs
- TreeWalkHelper.cs
- BitmapEffectInput.cs
- ChtmlImageAdapter.cs
- Region.cs
- CaseCqlBlock.cs
- CellParagraph.cs
- GroupBox.cs
- FlowDocumentPageViewerAutomationPeer.cs
- ContentValidator.cs
- WebPartConnectionsCloseVerb.cs
- CodeDOMUtility.cs
- AnnotationComponentManager.cs
- SafeArrayRankMismatchException.cs
- CodeIndexerExpression.cs
- DoubleMinMaxAggregationOperator.cs
- VoiceSynthesis.cs
- MarkupProperty.cs
- xmlfixedPageInfo.cs
- PermissionSet.cs
- XmlSchemaFacet.cs
- EdgeModeValidation.cs
- FileLevelControlBuilderAttribute.cs
- RoutingTable.cs
- XmlSignatureProperties.cs
- OracleTimeSpan.cs
- HtmlInputRadioButton.cs
- UpdatableWrapper.cs
- AssemblyResourceLoader.cs
- Globals.cs
- Rotation3DAnimation.cs
- SystemWebExtensionsSectionGroup.cs
- ControlParameter.cs
- WebConfigurationFileMap.cs
- ObjectQueryProvider.cs
- SocketAddress.cs
- MethodAccessException.cs
- SingleAnimationBase.cs
- ObjectNavigationPropertyMapping.cs
- JoinSymbol.cs
- EmptyControlCollection.cs
- Base64Stream.cs
- ContainsSearchOperator.cs
- Nodes.cs
- ObjectListDataBindEventArgs.cs
- HScrollProperties.cs
- WebSysDefaultValueAttribute.cs
- EntityViewGenerator.cs
- SendingRequestEventArgs.cs
- StringAnimationBase.cs
- ListBoxItemAutomationPeer.cs
- cryptoapiTransform.cs
- WebPartsPersonalization.cs
- Roles.cs
- ActivityMarkupSerializationProvider.cs
- DiscoveryService.cs
- StateDesigner.Helpers.cs
- ListView.cs
- GraphicsPathIterator.cs
- ObjectListCommand.cs
- WebPartCloseVerb.cs
- IndexedSelectQueryOperator.cs
- CodeSubDirectory.cs
- HttpFileCollectionBase.cs
- SystemResources.cs
- XmlReflectionImporter.cs
- TextEffect.cs
- DefaultAsyncDataDispatcher.cs
- SystemUdpStatistics.cs
- BinHexDecoder.cs
- util.cs
- DrawToolTipEventArgs.cs
- ColumnHeaderConverter.cs
- OleDbConnection.cs
- RoutedPropertyChangedEventArgs.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- SqlDataSourceQueryConverter.cs
- TdsEnums.cs
- DPTypeDescriptorContext.cs
- AnnouncementInnerClientCD1.cs
- SigningProgress.cs
- BinaryConverter.cs
- CompoundFileDeflateTransform.cs
- FunctionMappingTranslator.cs
- BoundingRectTracker.cs
- _emptywebproxy.cs
- UIElementHelper.cs
- SerialPort.cs
- FileIOPermission.cs