Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Base / System / Windows / DependencyPropertyKey.cs / 1 / DependencyPropertyKey.cs
using System; using System.Diagnostics; // For Assert namespace System.Windows { ////// Authorization key for access to read-only DependencyProperty. /// Acquired via DependencyProperty.RegisterReadOnly/RegisterAttachedReadOnly /// and used in DependencyObject.SetValue/ClearValue. /// ////// This object can have a transient state upon creation where the _dp /// field can be null until initialized. However in use _dp needs to always /// be non-null. Otherwise it is treated as a key that can't unlock anything. /// (When needed, this property is available via the static constant NoAccess. /// public sealed class DependencyPropertyKey { ////// The DependencyProperty associated with this access key. This key /// does not authorize access to any other property. /// public DependencyProperty DependencyProperty { get { return _dp; } } internal DependencyPropertyKey(DependencyProperty dp) { _dp = dp; } ////// Override the metadata of a property that is already secured with /// this key. /// public void OverrideMetadata( Type forType, PropertyMetadata typeMetadata ) { if( _dp == null ) { throw new InvalidOperationException(); } _dp.OverrideMetadata( forType, typeMetadata, this ); } // This is not a property setter because we can't have a public // property getter and a internal property setter on the same property. internal void SetDependencyProperty(DependencyProperty dp) { Debug.Assert(_dp==null,"This should only be used when we need a placeholder and have a temporary value of null. It should not be used to change this property."); _dp = dp; } private DependencyProperty _dp = null; } } // 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
- SharedRuntimeState.cs
- LabelLiteral.cs
- ServiceContractGenerationContext.cs
- XmlTextAttribute.cs
- AccessDataSource.cs
- CodeGeneratorOptions.cs
- CopyOnWriteList.cs
- XmlQueryRuntime.cs
- PropertyChangingEventArgs.cs
- InputMethodStateTypeInfo.cs
- InputManager.cs
- UnsafePeerToPeerMethods.cs
- SmiRequestExecutor.cs
- XMLSyntaxException.cs
- ColorTransform.cs
- ImageListStreamer.cs
- EventManager.cs
- SchemaDeclBase.cs
- XPathParser.cs
- OdbcRowUpdatingEvent.cs
- TagMapCollection.cs
- ProtocolsConfiguration.cs
- HttpRuntimeSection.cs
- ImmutablePropertyDescriptorGridEntry.cs
- IntSecurity.cs
- Types.cs
- DriveNotFoundException.cs
- GenericPrincipal.cs
- FragmentNavigationEventArgs.cs
- ExpandedWrapper.cs
- ToolStripRenderEventArgs.cs
- ResolveMatchesCD1.cs
- ProcessHost.cs
- KeyEventArgs.cs
- WindowsGraphics2.cs
- TreeViewAutomationPeer.cs
- BufferedWebEventProvider.cs
- AtomParser.cs
- SoundPlayer.cs
- SqlNodeAnnotations.cs
- WebPart.cs
- InfiniteTimeSpanConverter.cs
- SecureUICommand.cs
- BackStopAuthenticationModule.cs
- Point4D.cs
- RC2CryptoServiceProvider.cs
- XmlTextEncoder.cs
- ParseElement.cs
- NameValueCache.cs
- BindableAttribute.cs
- GPPOINT.cs
- processwaithandle.cs
- DCSafeHandle.cs
- RawStylusInput.cs
- MessageBox.cs
- ScalarType.cs
- InheritanceUI.cs
- Exceptions.cs
- ReadWriteSpinLock.cs
- InternalCache.cs
- XmlSchemaComplexContentExtension.cs
- ProgramPublisher.cs
- HashAlgorithm.cs
- TextSpanModifier.cs
- ThicknessKeyFrameCollection.cs
- LicenseProviderAttribute.cs
- ListDataHelper.cs
- IsolatedStorageException.cs
- XmlReflectionMember.cs
- HealthMonitoringSection.cs
- WebRequest.cs
- SelectorAutomationPeer.cs
- XmlQueryCardinality.cs
- AbstractSvcMapFileLoader.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- FrameworkContentElement.cs
- TagNameToTypeMapper.cs
- PixelFormats.cs
- CodeArgumentReferenceExpression.cs
- State.cs
- FontStyles.cs
- DeclarationUpdate.cs
- TextElement.cs
- IncrementalReadDecoders.cs
- CorrelationManager.cs
- ClassDataContract.cs
- PenThreadPool.cs
- ImageDrawing.cs
- PrtTicket_Public.cs
- DbReferenceCollection.cs
- CodeAttributeArgumentCollection.cs
- ILGenerator.cs
- XamlSerializerUtil.cs
- CellQuery.cs
- ImageIndexConverter.cs
- BamlLocalizer.cs
- FramingChannels.cs
- XPathDescendantIterator.cs
- DataGridViewIntLinkedList.cs
- BamlWriter.cs