Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Animation / PowerEase.cs / 1305600 / PowerEase.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation, 2008
//
// File: PowerEase.cs
//-----------------------------------------------------------------------------
namespace System.Windows.Media.Animation
{
///
/// This class implements an easing function that gives a polynomial curve of arbitrary degree.
/// If the curve you desire is cubic, quadratic, quartic, or quintic it is better to use the
/// specialized easing functions.
///
public class PowerEase : EasingFunctionBase
{
public PowerEase()
{
}
///
/// Power Property
///
public static readonly DependencyProperty PowerProperty =
DependencyProperty.Register(
"Power",
typeof(double),
typeof(PowerEase),
new PropertyMetadata(2.0));
///
/// Specifies the power for the polynomial equation.
///
public double Power
{
get
{
return (double)GetValue(PowerProperty);
}
set
{
SetValueInternal(PowerProperty, value);
}
}
protected override double EaseInCore(double normalizedTime)
{
double power = Math.Max(0.0, Power);
return Math.Pow(normalizedTime, power);
}
protected override Freezable CreateInstanceCore()
{
return new PowerEase();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation, 2008
//
// File: PowerEase.cs
//-----------------------------------------------------------------------------
namespace System.Windows.Media.Animation
{
///
/// This class implements an easing function that gives a polynomial curve of arbitrary degree.
/// If the curve you desire is cubic, quadratic, quartic, or quintic it is better to use the
/// specialized easing functions.
///
public class PowerEase : EasingFunctionBase
{
public PowerEase()
{
}
///
/// Power Property
///
public static readonly DependencyProperty PowerProperty =
DependencyProperty.Register(
"Power",
typeof(double),
typeof(PowerEase),
new PropertyMetadata(2.0));
///
/// Specifies the power for the polynomial equation.
///
public double Power
{
get
{
return (double)GetValue(PowerProperty);
}
set
{
SetValueInternal(PowerProperty, value);
}
}
protected override double EaseInCore(double normalizedTime)
{
double power = Math.Max(0.0, Power);
return Math.Pow(normalizedTime, power);
}
protected override Freezable CreateInstanceCore()
{
return new PowerEase();
}
}
}
// 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
- CompositionDesigner.cs
- LinkConverter.cs
- CaseInsensitiveComparer.cs
- ElementMarkupObject.cs
- DataFieldConverter.cs
- XmlNavigatorStack.cs
- WorkflowInvoker.cs
- XPathDocumentNavigator.cs
- InProcStateClientManager.cs
- SHA1CryptoServiceProvider.cs
- DropShadowEffect.cs
- XPathNavigatorKeyComparer.cs
- ProcessInputEventArgs.cs
- SemaphoreFullException.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- FormatterServices.cs
- TemplateApplicationHelper.cs
- Empty.cs
- ConsoleKeyInfo.cs
- ConnectionProviderAttribute.cs
- Queue.cs
- SizeFConverter.cs
- RegexReplacement.cs
- DataGridViewCellCollection.cs
- TransformPatternIdentifiers.cs
- TemplateBuilder.cs
- Main.cs
- WebControlAdapter.cs
- RevocationPoint.cs
- ChangeDirector.cs
- DefaultCommandExtensionCallback.cs
- EditorBrowsableAttribute.cs
- DbParameterHelper.cs
- ZipIOCentralDirectoryFileHeader.cs
- SetMemberBinder.cs
- NamespaceEmitter.cs
- EasingFunctionBase.cs
- SuppressMergeCheckAttribute.cs
- EnvelopeVersion.cs
- ObjectManager.cs
- ContentElement.cs
- Rect.cs
- InstanceOwnerException.cs
- CodeAttributeArgumentCollection.cs
- PropertiesTab.cs
- TextEditor.cs
- ValueConversionAttribute.cs
- SiteOfOriginContainer.cs
- DbProviderFactoriesConfigurationHandler.cs
- Dictionary.cs
- X509SecurityTokenAuthenticator.cs
- BatchParser.cs
- FieldMetadata.cs
- SqlRowUpdatedEvent.cs
- ListBoxItem.cs
- ResourceManager.cs
- AvTraceFormat.cs
- ClientApiGenerator.cs
- DataTableExtensions.cs
- SmiXetterAccessMap.cs
- GridViewRowEventArgs.cs
- AttachedPropertyInfo.cs
- UserMapPath.cs
- SequenceDesigner.cs
- DrawingContext.cs
- StaticSiteMapProvider.cs
- ImmutableCommunicationTimeouts.cs
- StructuralType.cs
- KeyGesture.cs
- Material.cs
- DiscoveryInnerClientManaged11.cs
- DataGridCommandEventArgs.cs
- WorkflowControlClient.cs
- GrammarBuilderRuleRef.cs
- DocumentSequenceHighlightLayer.cs
- CellConstantDomain.cs
- DrawingContextDrawingContextWalker.cs
- DiscardableAttribute.cs
- CurrencyManager.cs
- SafePointer.cs
- ListViewDataItem.cs
- Profiler.cs
- VisualStyleInformation.cs
- TimeSpanStorage.cs
- SystemIcmpV6Statistics.cs
- VirtualizedContainerService.cs
- DecoderExceptionFallback.cs
- SettingsProperty.cs
- ListenerElementsCollection.cs
- ConnectorDragDropGlyph.cs
- SafeCryptoHandles.cs
- NonParentingControl.cs
- CustomPopupPlacement.cs
- ToolboxBitmapAttribute.cs
- Screen.cs
- validationstate.cs
- NullableFloatMinMaxAggregationOperator.cs
- CachedPathData.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- ToolboxItem.cs