diff --git a/AnimationX/AnimationX.csproj b/AnimationX/AnimationX.csproj index 9be012d..e21e06c 100644 --- a/AnimationX/AnimationX.csproj +++ b/AnimationX/AnimationX.csproj @@ -1,14 +1,14 @@ - + - - net6.0-windows - enable - true - 1.5.0 - + + net6.0-windows + enable + true + 1.5.0 + - - - + + + - + \ No newline at end of file diff --git a/AnimationX/Class/Helper/AnimationHelper.cs b/AnimationX/Class/Helper/AnimationHelper.cs index 8f6d5fe..30607c9 100644 --- a/AnimationX/Class/Helper/AnimationHelper.cs +++ b/AnimationX/Class/Helper/AnimationHelper.cs @@ -1,16 +1,16 @@ -using AnimationX.Class.Model.Animations; -using AnimationX.Interface; -using System; +using System; using System.Collections.Generic; using System.Threading; using System.Windows; using System.Windows.Media; +using AnimationX.Class.Model.Animations; +using AnimationX.Interface; namespace AnimationX.Class.Helper; public static class AnimationHelper { - private static readonly ReaderWriterLockSlim Lock = new (LockRecursionPolicy.NoRecursion); + private static readonly ReaderWriterLockSlim Lock = new(LockRecursionPolicy.NoRecursion); private static readonly List AnimationList; private static long _lastTick = DateTime.Now.Ticks; @@ -19,7 +19,7 @@ static AnimationHelper() SleepTime = TimeSpan.FromSeconds(1d / TimeLineAnimationBase.DesiredFrameRate).TotalSeconds * TimeSpan.TicksPerSecond; AnimationList = new List(); - + CompositionTarget.Rendering += CompositionTargetOnRendering; } @@ -42,7 +42,7 @@ private static void Compute() Lock.ExitReadLock(); if (count == 0) return; - + for (var i = count - 1; i >= 0; i--) { Lock.TryEnterReadLock(100); @@ -62,7 +62,7 @@ private static void Compute() } animation.ComputeNextFrame(); - } + } } internal static void CommitAnimation(this IComputableAnimation ani) @@ -73,7 +73,7 @@ internal static void CommitAnimation(this IComputableAnimation ani) AnimationList.Remove(ani); AnimationList.Add(ani); - + Lock.ExitWriteLock(); }