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
- Attributes.cs
- EncodingDataItem.cs
- XmlWrappingWriter.cs
- VisualCollection.cs
- RemotingConfiguration.cs
- X509Certificate.cs
- DelegatedStream.cs
- PhoneCall.cs
- EventPrivateKey.cs
- ParallelTimeline.cs
- ColorBuilder.cs
- SymmetricKeyWrap.cs
- DesignerLinkAdapter.cs
- SynchronizationLockException.cs
- TimeSpanMinutesConverter.cs
- OdbcConnectionHandle.cs
- CompoundFileReference.cs
- PersonalizableTypeEntry.cs
- indexingfiltermarshaler.cs
- ConstraintStruct.cs
- SqlProviderUtilities.cs
- BaseDataBoundControl.cs
- CellQuery.cs
- StickyNote.cs
- Size.cs
- InvokeHandlers.cs
- ResourceManager.cs
- ComboBox.cs
- GlyphingCache.cs
- DocumentViewerBaseAutomationPeer.cs
- InfiniteIntConverter.cs
- ReadOnlyDataSourceView.cs
- metadatamappinghashervisitor.cs
- InputQueue.cs
- FileResponseElement.cs
- FileSecurity.cs
- TypeListConverter.cs
- PermissionAttributes.cs
- LayoutSettings.cs
- ContentIterators.cs
- GPRECT.cs
- Visual3D.cs
- CodeSnippetStatement.cs
- SpellCheck.cs
- AliasedSlot.cs
- XmlResolver.cs
- XmlAnyAttributeAttribute.cs
- TimeoutStream.cs
- RegionData.cs
- ApplicationId.cs
- EntityRecordInfo.cs
- SystemDiagnosticsSection.cs
- SqlConnectionString.cs
- DataGridTextBoxColumn.cs
- TaskScheduler.cs
- SourceFilter.cs
- InvokePattern.cs
- AdvancedBindingPropertyDescriptor.cs
- HtmlInputSubmit.cs
- DescendantBaseQuery.cs
- PrimitiveSchema.cs
- IList.cs
- VirtualPathUtility.cs
- PrintSystemException.cs
- CompoundFileReference.cs
- CellParagraph.cs
- X500Name.cs
- PropertyItem.cs
- ServiceOperationWrapper.cs
- PagePropertiesChangingEventArgs.cs
- TypeToken.cs
- EventLogTraceListener.cs
- Axis.cs
- BinaryObjectReader.cs
- Attribute.cs
- DataGridRowHeaderAutomationPeer.cs
- TypePropertyEditor.cs
- mda.cs
- WindowsRebar.cs
- contentDescriptor.cs
- CodeMethodInvokeExpression.cs
- DataTemplate.cs
- AlphaSortedEnumConverter.cs
- ForwardPositionQuery.cs
- DataTableMapping.cs
- TypeUnloadedException.cs
- Certificate.cs
- MarshalByRefObject.cs
- PropertyStore.cs
- ResizeGrip.cs
- SplineKeyFrames.cs
- EventMappingSettings.cs
- CommunicationObjectAbortedException.cs
- DependencyPropertyValueSerializer.cs
- NameTable.cs
- ScriptModule.cs
- TableRowCollection.cs
- QuaternionAnimationBase.cs
- COM2ExtendedUITypeEditor.cs
- SQLString.cs