Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Media / Animation / SetStoryboardSpeedRatio.cs / 1305600 / SetStoryboardSpeedRatio.cs
/****************************************************************************\ * * File: SetStoryboardSpeedRatio.cs * * This object includes a Storyboard reference. When triggered, the Storyboard * speed ratio is set to the given parameter. * * Copyright (C) by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System.ComponentModel; // DefaultValueAttribute using System.Diagnostics; // Debug.Assert namespace System.Windows.Media.Animation { ////// SetStoryboardSpeedRatio will set the speed for its Storyboard reference when /// it is triggered. /// public sealed class SetStoryboardSpeedRatio : ControllableStoryboardAction { ////// A speed ratio to use for this action. If it is never explicitly /// specified, it is 1.0. /// [DefaultValue(1.0)] public double SpeedRatio { get { return _speedRatio; } set { if (IsSealed) { throw new InvalidOperationException(SR.Get(SRID.CannotChangeAfterSealed, "SetStoryboardSpeedRatio")); } _speedRatio = value; } } ////// Called when it's time to execute this storyboard action /// internal override void Invoke( FrameworkElement containingFE, FrameworkContentElement containingFCE, Storyboard storyboard ) { Debug.Assert( containingFE != null || containingFCE != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); if( containingFE != null ) { storyboard.SetSpeedRatio(containingFE, SpeedRatio); } else { storyboard.SetSpeedRatio(containingFCE, SpeedRatio); } } double _speedRatio = 1.0; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /****************************************************************************\ * * File: SetStoryboardSpeedRatio.cs * * This object includes a Storyboard reference. When triggered, the Storyboard * speed ratio is set to the given parameter. * * Copyright (C) by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System.ComponentModel; // DefaultValueAttribute using System.Diagnostics; // Debug.Assert namespace System.Windows.Media.Animation { ////// SetStoryboardSpeedRatio will set the speed for its Storyboard reference when /// it is triggered. /// public sealed class SetStoryboardSpeedRatio : ControllableStoryboardAction { ////// A speed ratio to use for this action. If it is never explicitly /// specified, it is 1.0. /// [DefaultValue(1.0)] public double SpeedRatio { get { return _speedRatio; } set { if (IsSealed) { throw new InvalidOperationException(SR.Get(SRID.CannotChangeAfterSealed, "SetStoryboardSpeedRatio")); } _speedRatio = value; } } ////// Called when it's time to execute this storyboard action /// internal override void Invoke( FrameworkElement containingFE, FrameworkContentElement containingFCE, Storyboard storyboard ) { Debug.Assert( containingFE != null || containingFCE != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); if( containingFE != null ) { storyboard.SetSpeedRatio(containingFE, SpeedRatio); } else { storyboard.SetSpeedRatio(containingFCE, SpeedRatio); } } double _speedRatio = 1.0; } } // 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
- RecommendedAsConfigurableAttribute.cs
- Pen.cs
- ToolboxComponentsCreatedEventArgs.cs
- StateManagedCollection.cs
- GcHandle.cs
- XmlILModule.cs
- PageAsyncTask.cs
- CryptographicAttribute.cs
- DataGridCheckBoxColumn.cs
- Italic.cs
- HwndMouseInputProvider.cs
- TableHeaderCell.cs
- DataGridRowDetailsEventArgs.cs
- ContainsRowNumberChecker.cs
- ParserExtension.cs
- __ComObject.cs
- Asn1Utilities.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- TextServicesCompartmentEventSink.cs
- DomainUpDown.cs
- WebHeaderCollection.cs
- ImageListUtils.cs
- Label.cs
- GridViewDeleteEventArgs.cs
- MarshalDirectiveException.cs
- WebConfigurationHostFileChange.cs
- FileAuthorizationModule.cs
- AuthenticationSection.cs
- TimeSpanValidator.cs
- WinInetCache.cs
- MarginsConverter.cs
- OrderingQueryOperator.cs
- HttpApplicationFactory.cs
- ForwardPositionQuery.cs
- ControlBuilder.cs
- TriggerBase.cs
- PasswordTextContainer.cs
- ChannelBinding.cs
- DataContract.cs
- Base64Decoder.cs
- HttpCacheVaryByContentEncodings.cs
- NativeActivityFaultContext.cs
- WindowsListViewGroupSubsetLink.cs
- MemoryStream.cs
- WasNotInstalledException.cs
- LazyTextWriterCreator.cs
- ConfigXmlComment.cs
- DataControlFieldCell.cs
- SecurityCookieModeValidator.cs
- GAC.cs
- WebBrowser.cs
- FileIOPermission.cs
- GenerateTemporaryTargetAssembly.cs
- RowUpdatingEventArgs.cs
- Base64Encoder.cs
- BreakRecordTable.cs
- ToolBar.cs
- CompilerCollection.cs
- EmptyReadOnlyDictionaryInternal.cs
- DataSourceGroupCollection.cs
- DataBinder.cs
- HotCommands.cs
- ProcessInfo.cs
- OleDbMetaDataFactory.cs
- GifBitmapEncoder.cs
- ConstructorExpr.cs
- FormatException.cs
- ApplicationException.cs
- PkcsUtils.cs
- DatagridviewDisplayedBandsData.cs
- ClientSideQueueItem.cs
- DataViewManager.cs
- DataListItemEventArgs.cs
- LookupBindingPropertiesAttribute.cs
- TypeBuilderInstantiation.cs
- WindowsStartMenu.cs
- OperationInfo.cs
- storagemappingitemcollection.viewdictionary.cs
- Int32CAMarshaler.cs
- OleDbTransaction.cs
- PerformanceCountersElement.cs
- Profiler.cs
- ToolBarButtonClickEvent.cs
- DataBindingCollection.cs
- MaterialGroup.cs
- BaseResourcesBuildProvider.cs
- DrawToolTipEventArgs.cs
- SourceFileBuildProvider.cs
- WebPartHeaderCloseVerb.cs
- SmiEventSink_Default.cs
- SectionRecord.cs
- ReadOnlyAttribute.cs
- SafeSerializationManager.cs
- TableLayout.cs
- DbProviderFactories.cs
- CngProperty.cs
- PrimarySelectionAdorner.cs
- ToolStripHighContrastRenderer.cs
- EventBuilder.cs
- ExecutionContext.cs