Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- TypeContext.cs
- DataFormat.cs
- StateMachineSubscription.cs
- PageCodeDomTreeGenerator.cs
- LineBreakRecord.cs
- DataStorage.cs
- SectionVisual.cs
- ProvidersHelper.cs
- MetadataArtifactLoaderFile.cs
- ElementProxy.cs
- ExpandableObjectConverter.cs
- AttributedMetaModel.cs
- MetadataCache.cs
- IPEndPointCollection.cs
- StringToken.cs
- DependencyProperty.cs
- CriticalHandle.cs
- TableCellCollection.cs
- SortedDictionary.cs
- HttpHeaderCollection.cs
- CompilerGlobalScopeAttribute.cs
- TextServicesCompartmentContext.cs
- ColorMap.cs
- CodeMethodReturnStatement.cs
- SqlInternalConnectionTds.cs
- TakeOrSkipWhileQueryOperator.cs
- XPathNavigatorReader.cs
- ListViewDataItem.cs
- XmlSignatureProperties.cs
- CqlLexer.cs
- TemplateBamlRecordReader.cs
- ServiceNameCollection.cs
- MultipartContentParser.cs
- DBParameter.cs
- UniqueIdentifierService.cs
- ObjectFullSpanRewriter.cs
- MenuRenderer.cs
- EventLogPermissionAttribute.cs
- WebServiceTypeData.cs
- EngineSiteSapi.cs
- HMACSHA384.cs
- OlePropertyStructs.cs
- ImageAutomationPeer.cs
- XPathNodeHelper.cs
- ToolStripEditorManager.cs
- ContextMenuAutomationPeer.cs
- backend.cs
- SplashScreen.cs
- XmlSchemaComplexContentRestriction.cs
- TypefaceMetricsCache.cs
- RTLAwareMessageBox.cs
- CombinedGeometry.cs
- SerialPort.cs
- LostFocusEventManager.cs
- WebDisplayNameAttribute.cs
- WindowsPrincipal.cs
- EntityProxyFactory.cs
- BevelBitmapEffect.cs
- DesignTimeParseData.cs
- EntityDataSourceContextCreatingEventArgs.cs
- NamespaceEmitter.cs
- DatagridviewDisplayedBandsData.cs
- PropertiesTab.cs
- CodeChecksumPragma.cs
- GridItemCollection.cs
- PixelFormat.cs
- RegexWriter.cs
- StyleHelper.cs
- WebPartChrome.cs
- WebDescriptionAttribute.cs
- WebBrowserNavigatedEventHandler.cs
- ListBindingHelper.cs
- XmlElementAttribute.cs
- SizeValueSerializer.cs
- ServiceDeploymentInfo.cs
- TreeViewImageGenerator.cs
- PriorityQueue.cs
- CurrentChangingEventManager.cs
- ViewStateModeByIdAttribute.cs
- ErrorRuntimeConfig.cs
- DbException.cs
- ToolStripEditorManager.cs
- AppSettingsExpressionEditor.cs
- EditorPartCollection.cs
- StylusPointPropertyId.cs
- StopStoryboard.cs
- DeviceSpecific.cs
- ProfilePropertySettings.cs
- OdbcDataAdapter.cs
- EnumerableRowCollectionExtensions.cs
- ThemeableAttribute.cs
- HttpWriter.cs
- HasCopySemanticsAttribute.cs
- DataServiceQueryOfT.cs
- InstanceData.cs
- AuthenticatedStream.cs
- ProfileElement.cs
- TaiwanLunisolarCalendar.cs
- ScalarType.cs
- MaterializeFromAtom.cs