Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / UIPropertyMetadata.cs / 1 / UIPropertyMetadata.cs
using MS.Utility; using System; using System.Collections.Generic; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows { ////// Metadata for supported UI features /// public class UIPropertyMetadata : PropertyMetadata { ////// UI metadata construction /// public UIPropertyMetadata() : base() { } ////// UI metadata construction /// /// Default value of property public UIPropertyMetadata(object defaultValue) : base(defaultValue) { } ////// UI metadata construction /// /// Called when the property has been changed public UIPropertyMetadata(PropertyChangedCallback propertyChangedCallback) : base(propertyChangedCallback) { } ////// UI metadata construction /// /// Default value of property /// Called when the property has been changed public UIPropertyMetadata(object defaultValue, PropertyChangedCallback propertyChangedCallback) : base(defaultValue, propertyChangedCallback) { } ////// UI metadata construction /// /// Default value of property /// Called when the property has been changed /// Called on update of value public UIPropertyMetadata(object defaultValue, PropertyChangedCallback propertyChangedCallback, CoerceValueCallback coerceValueCallback) : base(defaultValue, propertyChangedCallback, coerceValueCallback) { } ////// UI metadata construction /// /// Default value of property /// Called when the property has been changed /// Called on update of value /// Should animation be prohibited? public UIPropertyMetadata(object defaultValue, PropertyChangedCallback propertyChangedCallback, CoerceValueCallback coerceValueCallback, bool isAnimationProhibited) : base(defaultValue, propertyChangedCallback, coerceValueCallback) { WriteFlag(MetadataFlags.UI_IsAnimationProhibitedID, isAnimationProhibited); } ////// Creates a new instance of this property metadata. This method is used /// when metadata needs to be cloned. After CreateInstance is called the /// framework will call Merge to merge metadata into the new instance. /// Deriving classes must override this and return a new instance of /// themselves. /// internal override PropertyMetadata CreateInstance() { return new UIPropertyMetadata(); } ////// Set this to true for a property for which animation should be /// prohibited. This should not be set unless there are very strong /// technical reasons why a property can not be animated. In the /// vast majority of cases, a property that can not be properly /// animated means that the property implementation contains a bug. /// public bool IsAnimationProhibited { get { return ReadFlag(MetadataFlags.UI_IsAnimationProhibitedID); } set { if (Sealed) { throw new InvalidOperationException(SR.Get(SRID.TypeMetadataCannotChangeAfterUse)); } WriteFlag(MetadataFlags.UI_IsAnimationProhibitedID, value); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using MS.Utility; using System; using System.Collections.Generic; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows { ////// Metadata for supported UI features /// public class UIPropertyMetadata : PropertyMetadata { ////// UI metadata construction /// public UIPropertyMetadata() : base() { } ////// UI metadata construction /// /// Default value of property public UIPropertyMetadata(object defaultValue) : base(defaultValue) { } ////// UI metadata construction /// /// Called when the property has been changed public UIPropertyMetadata(PropertyChangedCallback propertyChangedCallback) : base(propertyChangedCallback) { } ////// UI metadata construction /// /// Default value of property /// Called when the property has been changed public UIPropertyMetadata(object defaultValue, PropertyChangedCallback propertyChangedCallback) : base(defaultValue, propertyChangedCallback) { } ////// UI metadata construction /// /// Default value of property /// Called when the property has been changed /// Called on update of value public UIPropertyMetadata(object defaultValue, PropertyChangedCallback propertyChangedCallback, CoerceValueCallback coerceValueCallback) : base(defaultValue, propertyChangedCallback, coerceValueCallback) { } ////// UI metadata construction /// /// Default value of property /// Called when the property has been changed /// Called on update of value /// Should animation be prohibited? public UIPropertyMetadata(object defaultValue, PropertyChangedCallback propertyChangedCallback, CoerceValueCallback coerceValueCallback, bool isAnimationProhibited) : base(defaultValue, propertyChangedCallback, coerceValueCallback) { WriteFlag(MetadataFlags.UI_IsAnimationProhibitedID, isAnimationProhibited); } ////// Creates a new instance of this property metadata. This method is used /// when metadata needs to be cloned. After CreateInstance is called the /// framework will call Merge to merge metadata into the new instance. /// Deriving classes must override this and return a new instance of /// themselves. /// internal override PropertyMetadata CreateInstance() { return new UIPropertyMetadata(); } ////// Set this to true for a property for which animation should be /// prohibited. This should not be set unless there are very strong /// technical reasons why a property can not be animated. In the /// vast majority of cases, a property that can not be properly /// animated means that the property implementation contains a bug. /// public bool IsAnimationProhibited { get { return ReadFlag(MetadataFlags.UI_IsAnimationProhibitedID); } set { if (Sealed) { throw new InvalidOperationException(SR.Get(SRID.TypeMetadataCannotChangeAfterUse)); } WriteFlag(MetadataFlags.UI_IsAnimationProhibitedID, value); } } } } // 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
- WindowsStatusBar.cs
- Effect.cs
- InvokeFunc.cs
- Journaling.cs
- SiteOfOriginContainer.cs
- ScrollBar.cs
- CheckBoxFlatAdapter.cs
- _Connection.cs
- JsonServiceDocumentSerializer.cs
- RegexCompilationInfo.cs
- RotateTransform.cs
- TextDecorationUnitValidation.cs
- RemoteX509AsymmetricSecurityKey.cs
- StateMachineExecutionState.cs
- SelectionHighlightInfo.cs
- EdmProviderManifest.cs
- NumberAction.cs
- TextHidden.cs
- DebugView.cs
- ThemeDirectoryCompiler.cs
- DataGridRowsPresenter.cs
- EmptyControlCollection.cs
- SecurityCriticalDataForSet.cs
- CollectionsUtil.cs
- PenThreadWorker.cs
- URLIdentityPermission.cs
- TransactionChannelFaultConverter.cs
- SafeReadContext.cs
- WebUtil.cs
- PnrpPermission.cs
- Queue.cs
- _FixedSizeReader.cs
- PointConverter.cs
- EntityDesignerUtils.cs
- StorageAssociationTypeMapping.cs
- StringValidatorAttribute.cs
- PackagingUtilities.cs
- IncrementalReadDecoders.cs
- XmlSchemaIdentityConstraint.cs
- EmbeddedMailObjectsCollection.cs
- DataServiceContext.cs
- XmlSchemaImporter.cs
- PublisherIdentityPermission.cs
- DataFormats.cs
- SelectionRange.cs
- WebUtil.cs
- ColumnTypeConverter.cs
- KnownColorTable.cs
- UIElement3D.cs
- DelimitedListTraceListener.cs
- QueryPageSettingsEventArgs.cs
- nulltextnavigator.cs
- X509CertificateInitiatorClientCredential.cs
- Aes.cs
- QilDataSource.cs
- WCFModelStrings.Designer.cs
- Transactions.cs
- StringValidator.cs
- AddressHeaderCollection.cs
- DataTableCollection.cs
- BorderSidesEditor.cs
- EventLogPermissionHolder.cs
- Viewport3DVisual.cs
- ThreadStateException.cs
- NavigationEventArgs.cs
- ResXResourceWriter.cs
- RenderData.cs
- DataGridViewColumn.cs
- DefaultTextStoreTextComposition.cs
- DataReceivedEventArgs.cs
- TileModeValidation.cs
- NativeRightsManagementAPIsStructures.cs
- WindowsListViewGroup.cs
- BooleanStorage.cs
- OneOfTypeConst.cs
- Int32.cs
- UIElementPropertyUndoUnit.cs
- Select.cs
- WpfWebRequestHelper.cs
- basenumberconverter.cs
- X509Extension.cs
- SafeUserTokenHandle.cs
- ScriptResourceInfo.cs
- GenericUI.cs
- CompModSwitches.cs
- FrameAutomationPeer.cs
- DataColumnMapping.cs
- DBDataPermission.cs
- FormViewRow.cs
- PerspectiveCamera.cs
- MarkerProperties.cs
- RNGCryptoServiceProvider.cs
- _SSPIWrapper.cs
- AndMessageFilter.cs
- ProcessHostServerConfig.cs
- ListBox.cs
- SiteOfOriginPart.cs
- PointCollection.cs
- PagesChangedEventArgs.cs
- StatusBar.cs