Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Base / System / Windows / DependencyPropertyKey.cs / 1305600 / 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
- WebPartZone.cs
- CacheMode.cs
- Condition.cs
- PropertyTab.cs
- ReadOnlyKeyedCollection.cs
- XmlHierarchicalEnumerable.cs
- WmlMobileTextWriter.cs
- DataMemberAttribute.cs
- SkinIDTypeConverter.cs
- Mutex.cs
- FileNotFoundException.cs
- PerformanceCounterPermission.cs
- TextBoxDesigner.cs
- SqlConnection.cs
- EdmProviderManifest.cs
- SendMessageChannelCache.cs
- login.cs
- WorkflowTransactionService.cs
- CharConverter.cs
- TraceSource.cs
- CommandDevice.cs
- Splitter.cs
- ListViewUpdateEventArgs.cs
- DataProtectionSecurityStateEncoder.cs
- JsonUriDataContract.cs
- XamlInt32CollectionSerializer.cs
- TextClipboardData.cs
- DocumentReferenceCollection.cs
- prefixendpointaddressmessagefilter.cs
- Error.cs
- CodeCommentStatementCollection.cs
- QueryServiceConfigHandle.cs
- BitmapSourceSafeMILHandle.cs
- ValuePattern.cs
- Hyperlink.cs
- ApplicationInfo.cs
- BadImageFormatException.cs
- FontNamesConverter.cs
- SocketPermission.cs
- MissingManifestResourceException.cs
- PagePropertiesChangingEventArgs.cs
- ExceptionUtil.cs
- OneOfElement.cs
- StringFunctions.cs
- MetadataArtifactLoaderComposite.cs
- AspNetRouteServiceHttpHandler.cs
- WebBrowser.cs
- MenuCommand.cs
- JpegBitmapEncoder.cs
- ConversionContext.cs
- ConnectionPointCookie.cs
- ProcessManager.cs
- EasingFunctionBase.cs
- StorageEndPropertyMapping.cs
- SafePEFileHandle.cs
- ObjectDataSourceSelectingEventArgs.cs
- StylusPointProperties.cs
- ListViewEditEventArgs.cs
- NullableBoolConverter.cs
- ReplyChannelBinder.cs
- BoolLiteral.cs
- PropertyCondition.cs
- ReliableMessagingVersionConverter.cs
- ResourceDefaultValueAttribute.cs
- CrossContextChannel.cs
- FindSimilarActivitiesVerb.cs
- SmiRecordBuffer.cs
- SaveFileDialog.cs
- SqlException.cs
- IIS7WorkerRequest.cs
- PersonalizableAttribute.cs
- Command.cs
- StateChangeEvent.cs
- SecurityState.cs
- PageThemeCodeDomTreeGenerator.cs
- Matrix3DConverter.cs
- TransformedBitmap.cs
- Rotation3D.cs
- ConsumerConnectionPoint.cs
- WebPartEventArgs.cs
- DefaultProxySection.cs
- DesignTimeSiteMapProvider.cs
- MessageHeaders.cs
- Byte.cs
- BindingUtils.cs
- Root.cs
- PagesSection.cs
- NumericExpr.cs
- PkcsMisc.cs
- UserInitiatedNavigationPermission.cs
- SocketElement.cs
- GradientStopCollection.cs
- ItemCollection.cs
- Privilege.cs
- SortedDictionary.cs
- SqlStatistics.cs
- MissingMemberException.cs
- FlowDocumentPage.cs
- PanelDesigner.cs
- CompilerParameters.cs