12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- namespace Microsoft.Windows.Forms.Animate
- {
-
-
-
- public sealed class UILinearAnimation : Animation<float>
- {
-
-
-
- public const int DEFAULT_ANIMATION_SPAN = 200;
- private float m_From;
-
-
-
- public float From
- {
- get { return this.m_From; }
- set { this.m_From = value; }
- }
- private float m_To;
-
-
-
- public float To
- {
- get { return this.m_To; }
- set { this.m_To = value; }
- }
- private float m_Current;
-
-
-
- public override float Current
- {
- get
- {
- if (this.m_From >= this.m_To)
- {
- this.Stop();
- return this.m_Current = this.m_To;
- }
- double percentage = this.Percentage;
- return this.m_Current = (percentage == STOPPED ? this.m_To : (float)(this.m_From + (this.m_To - this.m_From) * percentage));
- }
- }
-
-
-
- public UILinearAnimation()
- {
- base.Span = DEFAULT_ANIMATION_SPAN;
- }
-
-
-
-
- public void Continue(float to)
- {
- this.m_From = this.m_Current;
- this.m_To = to;
- this.Start();
- }
-
-
-
- public void Next()
- {
- base.Start();
- }
-
-
-
- public new void Stop()
- {
- base.Stop();
- }
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- }
- }
- }
|