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
- Crc32Helper.cs
- GridSplitterAutomationPeer.cs
- ObjectQueryExecutionPlan.cs
- DataGridCellsPanel.cs
- WebPartConnectionCollection.cs
- PageClientProxyGenerator.cs
- OperationInfoBase.cs
- webproxy.cs
- XPathBuilder.cs
- CreateUserWizard.cs
- ExpressionConverter.cs
- Activation.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- EntityDataSourceDesigner.cs
- DesignParameter.cs
- XmlSerializerNamespaces.cs
- FrameworkTemplate.cs
- SaveFileDialog.cs
- TableLayoutPanelCellPosition.cs
- CodeAssignStatement.cs
- InArgument.cs
- KnownTypes.cs
- ScaleTransform.cs
- OpenFileDialog.cs
- DataGridView.cs
- FontSizeConverter.cs
- SatelliteContractVersionAttribute.cs
- ConnectionProviderAttribute.cs
- GroupStyle.cs
- Material.cs
- ADRole.cs
- SafeFreeMibTable.cs
- _CommandStream.cs
- BindMarkupExtensionSerializer.cs
- SettingsPropertyValue.cs
- MissingMethodException.cs
- MessageQueue.cs
- TextBoxAutoCompleteSourceConverter.cs
- LeafCellTreeNode.cs
- WorkflowExecutor.cs
- SnapLine.cs
- BufferedStream.cs
- DragEventArgs.cs
- Screen.cs
- TableCellCollection.cs
- ArgIterator.cs
- HostSecurityManager.cs
- ClientFormsIdentity.cs
- GenerateDerivedKeyRequest.cs
- RichTextBoxConstants.cs
- QilVisitor.cs
- RequestCachingSection.cs
- TransportConfigurationTypeElement.cs
- DiscoveryMessageSequenceGenerator.cs
- RuntimeArgumentHandle.cs
- CharAnimationBase.cs
- AddInAttribute.cs
- XamlPoint3DCollectionSerializer.cs
- UnmanagedMemoryStreamWrapper.cs
- StrokeRenderer.cs
- DeferredElementTreeState.cs
- BulletChrome.cs
- XmlSchemaGroupRef.cs
- CommandDevice.cs
- FormViewRow.cs
- CodeParameterDeclarationExpression.cs
- BufferedGraphicsManager.cs
- ServicesUtilities.cs
- ZipIOCentralDirectoryFileHeader.cs
- ImmutableDispatchRuntime.cs
- VirtualPathUtility.cs
- BindingMAnagerBase.cs
- DataGridViewButtonColumn.cs
- MultiBindingExpression.cs
- KeyBinding.cs
- ObjectTag.cs
- AutomationPeer.cs
- DiscriminatorMap.cs
- JsonClassDataContract.cs
- Assembly.cs
- EventSetter.cs
- ReflectionUtil.cs
- MasterPage.cs
- ListViewTableRow.cs
- __ConsoleStream.cs
- DebugView.cs
- RelationshipConstraintValidator.cs
- WebPartHelpVerb.cs
- FormsIdentity.cs
- StringFormat.cs
- WebServiceTypeData.cs
- HwndTarget.cs
- BookmarkNameHelper.cs
- MatrixKeyFrameCollection.cs
- ComponentRenameEvent.cs
- XamlNamespaceHelper.cs
- ValidationPropertyAttribute.cs
- CancellationTokenSource.cs
- XMLDiffLoader.cs
- XmlMembersMapping.cs