Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / Animation / AnimationTimeline.cs / 1 / AnimationTimeline.cs
// AnimationTimeline.cs
using System;
using System.Diagnostics;
using System.Windows;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
namespace System.Windows.Media.Animation
{
///
///
///
public abstract class AnimationTimeline : Timeline
{
///
///
///
protected AnimationTimeline()
: base()
{
}
#region Dependency Properties
private static void AnimationTimeline_PropertyChangedFunction(DependencyObject d,
DependencyPropertyChangedEventArgs e)
{
((AnimationTimeline)d).PropertyChanged(e.Property);
}
///
///
///
public static readonly DependencyProperty IsAdditiveProperty =
DependencyProperty.Register(
"IsAdditive", // Property Name
typeof(bool), // Property Type
typeof(AnimationTimeline), // Owner Class
new PropertyMetadata(false,
new PropertyChangedCallback(AnimationTimeline_PropertyChangedFunction)));
///
///
///
public static readonly DependencyProperty IsCumulativeProperty =
DependencyProperty.Register(
"IsCumulative", // Property Name
typeof(bool), // Property Type
typeof(AnimationTimeline), // Owner Class
new PropertyMetadata(false,
new PropertyChangedCallback(AnimationTimeline_PropertyChangedFunction)));
#endregion
#region Freezable
///
/// Creates a copy of this AnimationTimeline.
///
/// The copy.
public new AnimationTimeline Clone()
{
return (AnimationTimeline)base.Clone();
}
#endregion
#region Timeline
///
///
///
///
protected internal override Clock AllocateClock()
{
return new AnimationClock(this);
}
///
/// Creates a new AnimationClock using this AnimationTimeline.
///
/// A new AnimationClock.
new public AnimationClock CreateClock()
{
return (AnimationClock)base.CreateClock();
}
#endregion
///
/// Calculates the value this animation believes should be the current value for the property.
///
///
/// This value is the suggested origin value provided to the animation
/// to be used if the animation does not have its own concept of a
/// start value. If this animation is not the first in a composition
/// chain this value will be the value returned by the previous
/// animation in the chain with an animationClock that is not Stopped.
///
///
/// This value is the suggested destination value provided to the animation
/// to be used if the animation does not have its own concept of an
/// end value. If this animation is not the first in a composition
/// chain this value will be the value returned by the previous
/// animation in the chain with an animationClock that is not Stopped.
///
///
/// This is the animationClock which can generate the CurrentTime or
/// CurrentProgress value to be used by the animation to generate its
/// output value.
///
///
/// The value this animation believes should be the current value for the property.
///
public virtual object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
{
ReadPreamble();
return defaultDestinationValue;
}
///
/// Provide a custom natural Duration when the Duration property is set to Automatic.
///
///
/// The Clock whose natural duration is desired.
///
///
/// A Duration quantity representing the natural duration. Default is 1 second for animations.
///
protected override Duration GetNaturalDurationCore(Clock clock)
{
return new TimeSpan(0, 0, 1);
}
///
/// Returns the type of the animation.
///
///
public abstract Type TargetPropertyType { get; }
///
/// This property is implemented by the animation to return true if the
/// animation uses the defaultDestinationValue parameter to the
/// GetCurrentValue method as its destination value. Specifically, if
/// Progress is equal to 1.0, will this animation return the
/// default destination value as its current value.
///
public virtual bool IsDestinationDefault
{
get
{
ReadPreamble();
return false;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
// AnimationTimeline.cs
using System;
using System.Diagnostics;
using System.Windows;
using SR=MS.Internal.PresentationCore.SR;
using SRID=MS.Internal.PresentationCore.SRID;
namespace System.Windows.Media.Animation
{
///
///
///
public abstract class AnimationTimeline : Timeline
{
///
///
///
protected AnimationTimeline()
: base()
{
}
#region Dependency Properties
private static void AnimationTimeline_PropertyChangedFunction(DependencyObject d,
DependencyPropertyChangedEventArgs e)
{
((AnimationTimeline)d).PropertyChanged(e.Property);
}
///
///
///
public static readonly DependencyProperty IsAdditiveProperty =
DependencyProperty.Register(
"IsAdditive", // Property Name
typeof(bool), // Property Type
typeof(AnimationTimeline), // Owner Class
new PropertyMetadata(false,
new PropertyChangedCallback(AnimationTimeline_PropertyChangedFunction)));
///
///
///
public static readonly DependencyProperty IsCumulativeProperty =
DependencyProperty.Register(
"IsCumulative", // Property Name
typeof(bool), // Property Type
typeof(AnimationTimeline), // Owner Class
new PropertyMetadata(false,
new PropertyChangedCallback(AnimationTimeline_PropertyChangedFunction)));
#endregion
#region Freezable
///
/// Creates a copy of this AnimationTimeline.
///
/// The copy.
public new AnimationTimeline Clone()
{
return (AnimationTimeline)base.Clone();
}
#endregion
#region Timeline
///
///
///
///
protected internal override Clock AllocateClock()
{
return new AnimationClock(this);
}
///
/// Creates a new AnimationClock using this AnimationTimeline.
///
/// A new AnimationClock.
new public AnimationClock CreateClock()
{
return (AnimationClock)base.CreateClock();
}
#endregion
///
/// Calculates the value this animation believes should be the current value for the property.
///
///
/// This value is the suggested origin value provided to the animation
/// to be used if the animation does not have its own concept of a
/// start value. If this animation is not the first in a composition
/// chain this value will be the value returned by the previous
/// animation in the chain with an animationClock that is not Stopped.
///
///
/// This value is the suggested destination value provided to the animation
/// to be used if the animation does not have its own concept of an
/// end value. If this animation is not the first in a composition
/// chain this value will be the value returned by the previous
/// animation in the chain with an animationClock that is not Stopped.
///
///
/// This is the animationClock which can generate the CurrentTime or
/// CurrentProgress value to be used by the animation to generate its
/// output value.
///
///
/// The value this animation believes should be the current value for the property.
///
public virtual object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
{
ReadPreamble();
return defaultDestinationValue;
}
///
/// Provide a custom natural Duration when the Duration property is set to Automatic.
///
///
/// The Clock whose natural duration is desired.
///
///
/// A Duration quantity representing the natural duration. Default is 1 second for animations.
///
protected override Duration GetNaturalDurationCore(Clock clock)
{
return new TimeSpan(0, 0, 1);
}
///
/// Returns the type of the animation.
///
///
public abstract Type TargetPropertyType { get; }
///
/// This property is implemented by the animation to return true if the
/// animation uses the defaultDestinationValue parameter to the
/// GetCurrentValue method as its destination value. Specifically, if
/// Progress is equal to 1.0, will this animation return the
/// default destination value as its current value.
///
public virtual bool IsDestinationDefault
{
get
{
ReadPreamble();
return false;
}
}
}
}
// 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
- CompilerGeneratedAttribute.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- DocumentSequenceHighlightLayer.cs
- DropDownButton.cs
- SqlUserDefinedTypeAttribute.cs
- RectAnimationClockResource.cs
- OptimisticConcurrencyException.cs
- CodeCommentStatementCollection.cs
- _FtpControlStream.cs
- ServiceProviders.cs
- CalloutQueueItem.cs
- SoapInteropTypes.cs
- GlobalEventManager.cs
- QilGeneratorEnv.cs
- entitydatasourceentitysetnameconverter.cs
- DataGridViewLinkColumn.cs
- MatrixTransform3D.cs
- ComponentEditorForm.cs
- AsyncStreamReader.cs
- RoutedUICommand.cs
- TransformerConfigurationWizardBase.cs
- EntityContainerEmitter.cs
- Int32.cs
- DmlSqlGenerator.cs
- NamedPipeConnectionPool.cs
- HttpResponseMessageProperty.cs
- LinkUtilities.cs
- DataAdapter.cs
- WindowCollection.cs
- Sentence.cs
- namescope.cs
- ApplicationSettingsBase.cs
- mediaeventargs.cs
- ClassicBorderDecorator.cs
- OneWayBindingElementImporter.cs
- Part.cs
- SiteMapNodeItemEventArgs.cs
- HostElement.cs
- CDSsyncETWBCLProvider.cs
- StrongNameSignatureInformation.cs
- ObfuscateAssemblyAttribute.cs
- XmlSchemaSimpleType.cs
- ProcessHostMapPath.cs
- DataGridViewColumnCollection.cs
- SourceFileBuildProvider.cs
- VariableReference.cs
- precedingquery.cs
- Stackframe.cs
- GetReadStreamResult.cs
- Brush.cs
- SymDocumentType.cs
- RegistrySecurity.cs
- SrgsElement.cs
- EntityDataSourceContainerNameItem.cs
- NetPeerTcpBinding.cs
- Composition.cs
- BitArray.cs
- EnumConverter.cs
- ListViewItemCollectionEditor.cs
- CodePageEncoding.cs
- ChildChangedEventArgs.cs
- Decimal.cs
- GcHandle.cs
- ConnectionManagementElementCollection.cs
- TextParagraphProperties.cs
- SmiEventSink.cs
- KnownAssemblyEntry.cs
- BuildProviderCollection.cs
- BaseCAMarshaler.cs
- ConnectivityStatus.cs
- Inflater.cs
- ZipIORawDataFileBlock.cs
- CallContext.cs
- serverconfig.cs
- ObjectContext.cs
- WindowsPrincipal.cs
- BitVector32.cs
- SqlConnection.cs
- PropertyChangingEventArgs.cs
- Preprocessor.cs
- DetailsViewPageEventArgs.cs
- ToolStripMenuItem.cs
- RoutedEvent.cs
- ReadOnlyDataSource.cs
- DbMetaDataCollectionNames.cs
- SimpleBitVector32.cs
- ControllableStoryboardAction.cs
- StyleXamlParser.cs
- Int64KeyFrameCollection.cs
- WebPartDeleteVerb.cs
- Pkcs9Attribute.cs
- TrackingServices.cs
- Label.cs
- SoapRpcServiceAttribute.cs
- ConfigurationManager.cs
- GridViewCommandEventArgs.cs
- AnnouncementEventArgs.cs
- ConcurrencyBehavior.cs
- UnsafePeerToPeerMethods.cs
- BindingGroup.cs