Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Media / Animation / SetStoryboardSpeedRatio.cs / 1 / 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
- LostFocusEventManager.cs
- Argument.cs
- ReadOnlyState.cs
- RuntimeHandles.cs
- TransactionState.cs
- CollectionDataContract.cs
- RawKeyboardInputReport.cs
- MouseWheelEventArgs.cs
- StreamWriter.cs
- EventLogEntry.cs
- SolidBrush.cs
- DependencyObject.cs
- CommonGetThemePartSize.cs
- DynamicExpression.cs
- InterleavedZipPartStream.cs
- WizardPanelChangingEventArgs.cs
- CssStyleCollection.cs
- HttpListenerPrefixCollection.cs
- Cursors.cs
- PeerInvitationResponse.cs
- XmlILModule.cs
- MultiTargetingUtil.cs
- IsolatedStorageSecurityState.cs
- ModuleBuilder.cs
- RoleManagerSection.cs
- PointHitTestParameters.cs
- ExcCanonicalXml.cs
- DefaultIfEmptyQueryOperator.cs
- ErrorInfoXmlDocument.cs
- FaultHandlingFilter.cs
- AssemblyCollection.cs
- ImportFileRequest.cs
- DummyDataSource.cs
- UnsafeNativeMethodsPenimc.cs
- ClosableStream.cs
- RepeaterItemCollection.cs
- IteratorFilter.cs
- NamespaceEmitter.cs
- MenuItemCollection.cs
- SortableBindingList.cs
- OdbcErrorCollection.cs
- CssTextWriter.cs
- WindowsRichEditRange.cs
- BaseResourcesBuildProvider.cs
- DbParameterCollectionHelper.cs
- XmlCountingReader.cs
- _Rfc2616CacheValidators.cs
- TransformProviderWrapper.cs
- DataGridView.cs
- MappingException.cs
- CachingHintValidation.cs
- HttpListenerRequestUriBuilder.cs
- TriggerBase.cs
- TextContainerHelper.cs
- SupportingTokenSpecification.cs
- FormViewPagerRow.cs
- SimpleMailWebEventProvider.cs
- ExpressionEditorAttribute.cs
- Button.cs
- WebPartUserCapability.cs
- BooleanAnimationUsingKeyFrames.cs
- SQLInt32.cs
- HtmlFormWrapper.cs
- TypedTableBaseExtensions.cs
- FormViewInsertedEventArgs.cs
- DirectoryObjectSecurity.cs
- DefaultValidator.cs
- UInt32Converter.cs
- MouseDevice.cs
- TcpChannelHelper.cs
- ContainerControl.cs
- MenuCommands.cs
- DocumentViewerBaseAutomationPeer.cs
- EpmContentSerializer.cs
- DataGridViewRow.cs
- LinqDataSourceInsertEventArgs.cs
- EncodingNLS.cs
- CompositeActivityCodeGenerator.cs
- XmlDocumentType.cs
- TracedNativeMethods.cs
- GC.cs
- SchemaImporter.cs
- EpmCustomContentSerializer.cs
- PointValueSerializer.cs
- WindowInteropHelper.cs
- Synchronization.cs
- ObjectViewFactory.cs
- AccessedThroughPropertyAttribute.cs
- PriorityQueue.cs
- ReturnEventArgs.cs
- DataGridViewColumnEventArgs.cs
- GridErrorDlg.cs
- Annotation.cs
- GZipDecoder.cs
- XmlBinaryWriter.cs
- StreamResourceInfo.cs
- OSFeature.cs
- TableCellCollection.cs
- GetFileNameResult.cs
- SqlDataSourceSelectingEventArgs.cs