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
- WorkflowShape.cs
- PopupControlService.cs
- DataGridViewCellValidatingEventArgs.cs
- ObjectHandle.cs
- CustomCredentialPolicy.cs
- Rules.cs
- ObservableCollectionDefaultValueFactory.cs
- Html32TextWriter.cs
- FormViewPageEventArgs.cs
- HtmlControlAdapter.cs
- XmlQualifiedName.cs
- BlurBitmapEffect.cs
- TableStyle.cs
- MetadataArtifactLoaderCompositeFile.cs
- ClientSponsor.cs
- TableItemPattern.cs
- TreeSet.cs
- RoamingStoreFileUtility.cs
- OperatingSystemVersionCheck.cs
- DelegateInArgument.cs
- WebPartRestoreVerb.cs
- StubHelpers.cs
- DataGridClipboardHelper.cs
- Grammar.cs
- Normalization.cs
- WebPartVerbsEventArgs.cs
- StrongNameMembershipCondition.cs
- ExceptionUtil.cs
- DiagnosticsConfiguration.cs
- Highlights.cs
- Int16AnimationBase.cs
- TargetControlTypeAttribute.cs
- DoubleStorage.cs
- documentsequencetextview.cs
- ListView.cs
- ClientCredentialsSecurityTokenManager.cs
- EncoderNLS.cs
- MeshGeometry3D.cs
- MergeFilterQuery.cs
- SmiXetterAccessMap.cs
- CompilerInfo.cs
- EntryIndex.cs
- DirectionalLight.cs
- ByteArrayHelperWithString.cs
- ListSourceHelper.cs
- WebPartAddingEventArgs.cs
- AvTraceDetails.cs
- CuspData.cs
- Events.cs
- SqlMultiplexer.cs
- ActivityContext.cs
- FixUpCollection.cs
- TdsParameterSetter.cs
- ContractListAdapter.cs
- KoreanLunisolarCalendar.cs
- PartBasedPackageProperties.cs
- Types.cs
- ClientSideQueueItem.cs
- ObjectDataSourceView.cs
- DataGridViewSortCompareEventArgs.cs
- TextParaClient.cs
- OdbcReferenceCollection.cs
- PieceDirectory.cs
- HatchBrush.cs
- HtmlMeta.cs
- CultureInfo.cs
- ChangeDirector.cs
- HtmlContainerControl.cs
- OutputScopeManager.cs
- RoutingUtilities.cs
- AuthenticateEventArgs.cs
- WebConvert.cs
- StreamResourceInfo.cs
- TimeoutException.cs
- WebBrowserBase.cs
- Transform3DGroup.cs
- NegationPusher.cs
- _BaseOverlappedAsyncResult.cs
- CharUnicodeInfo.cs
- SystemColorTracker.cs
- HtmlControl.cs
- AssemblyLoader.cs
- GraphicsPathIterator.cs
- Peer.cs
- StylusDownEventArgs.cs
- TraceEventCache.cs
- DateTimePicker.cs
- TransportManager.cs
- Queue.cs
- LayoutDump.cs
- _CookieModule.cs
- BooleanFunctions.cs
- DirtyTextRange.cs
- BoolExpr.cs
- ImpersonateTokenRef.cs
- ScrollPatternIdentifiers.cs
- EntityViewGenerationConstants.cs
- GeometryConverter.cs
- StringStorage.cs
- Object.cs