Browse Source

Change Run to RunAsync for convention's sake.

pull/1795/head
Jumar Macato 8 years ago
parent
commit
25808ea5d9
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 15
      src/Avalonia.Animation/Animation.cs
  2. 2
      src/Avalonia.Animation/IAnimation.cs

15
src/Avalonia.Animation/Animation.cs

@ -162,27 +162,24 @@ namespace Avalonia.Animation
}
/// <inheritdocs/>
public Task Run(Animatable control)
public Task RunAsync(Animatable control)
{
var tcs = new TaskCompletionSource<object>();
var run = new TaskCompletionSource<object>();
if (this.RepeatCount == RepeatCount.Loop)
{
tcs.SetException(new InvalidOperationException("Looping animations must not use the Run method."));
return tcs.Task;
}
run.SetException(new InvalidOperationException("Looping animations must not use the Run method."));
this.Done += (sender, args) =>
{
if (sender == control)
tcs.SetResult(null);
run.SetResult(null);
else
tcs.SetCanceled();
run.SetCanceled();
};
this.Apply(control, Observable.Return(true));
return tcs.Task;
return run.Task;
}
internal void SetDone(Animatable control)

2
src/Avalonia.Animation/IAnimation.cs

@ -18,6 +18,6 @@ namespace Avalonia.Animation
/// <summary>
/// Run the animation to the specified control
/// </summary>
Task Run(Animatable control);
Task RunAsync(Animatable control);
}
}
Loading…
Cancel
Save