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
- IIS7WorkerRequest.cs
- XmlIncludeAttribute.cs
- ValidatedControlConverter.cs
- LogicalExpressionTypeConverter.cs
- ProfileProvider.cs
- _BufferOffsetSize.cs
- _KerberosClient.cs
- DesignTimeValidationFeature.cs
- IPeerNeighbor.cs
- ApplicationBuildProvider.cs
- TemplatedControlDesigner.cs
- CustomPopupPlacement.cs
- DelegateBodyWriter.cs
- ReadOnlyHierarchicalDataSource.cs
- GradientStopCollection.cs
- ProfessionalColors.cs
- ToolStripSplitStackLayout.cs
- InfoCardUIAgent.cs
- DebugInfoExpression.cs
- JavascriptXmlWriterWrapper.cs
- PackageRelationshipSelector.cs
- LineServicesRun.cs
- ProvidePropertyAttribute.cs
- TextServicesProperty.cs
- VariableAction.cs
- WorkflowNamespace.cs
- SqlCacheDependency.cs
- FixedDSBuilder.cs
- SharedTcpTransportManager.cs
- ObjectDataSourceStatusEventArgs.cs
- DateTimeStorage.cs
- MetaModel.cs
- OdbcConnectionPoolProviderInfo.cs
- DiscoveryMessageSequenceCD1.cs
- DesignerRegion.cs
- ExpressionConverter.cs
- Collection.cs
- ColumnTypeConverter.cs
- ToolStripPanelRow.cs
- HighlightComponent.cs
- XmlWrappingReader.cs
- FileEnumerator.cs
- XmlSerializationReader.cs
- XmlTypeAttribute.cs
- _IPv6Address.cs
- FontConverter.cs
- UMPAttributes.cs
- util.cs
- EntityObject.cs
- WindowsTokenRoleProvider.cs
- CompilerError.cs
- TraceSection.cs
- PrintingPermission.cs
- DecimalAnimationUsingKeyFrames.cs
- ArgIterator.cs
- TextSpan.cs
- precedingsibling.cs
- RotateTransform3D.cs
- TextTreePropertyUndoUnit.cs
- SystemIPv4InterfaceProperties.cs
- precedingsibling.cs
- CustomAttributeSerializer.cs
- TransportConfigurationTypeElementCollection.cs
- LinqToSqlWrapper.cs
- LayoutTableCell.cs
- ObservableCollection.cs
- DotExpr.cs
- PropertyItem.cs
- ActivityInstanceReference.cs
- BindingContext.cs
- DataGridViewColumnConverter.cs
- XmlTextReaderImpl.cs
- ExtractedStateEntry.cs
- SiteOfOriginPart.cs
- XamlParser.cs
- DbConnectionStringBuilder.cs
- Exception.cs
- ExpressionConverter.cs
- SqlGenerator.cs
- DocumentGrid.cs
- FilterException.cs
- UInt64Storage.cs
- HwndProxyElementProvider.cs
- MessageSecurityOverTcp.cs
- DataGridViewCellPaintingEventArgs.cs
- FileUtil.cs
- HyperLinkField.cs
- TrackingProfileCache.cs
- InvokePatternIdentifiers.cs
- WebPartEditorApplyVerb.cs
- SoapSchemaMember.cs
- StorageSetMapping.cs
- SessionChannels.cs
- FormViewUpdatedEventArgs.cs
- Stackframe.cs
- DataGridViewHeaderCell.cs
- XmlSubtreeReader.cs
- SecureEnvironment.cs
- PropertyEntry.cs
- SessionStateUtil.cs