Esempio n. 1
0
        public override PatternActionResult Invoke(long time, PatternContext context)
        {
            if (State != PatternActionState.Enabled)
            {
                return(PatternActionResult.DoNothing);
            }

            var anchorTimes = context.GetAnchorTimes(Anchor);
            var newTime     = 0L;

            switch (AnchorPosition)
            {
            case AnchorPosition.First:
                newTime = anchorTimes.First();
                break;

            case AnchorPosition.Last:
                newTime = anchorTimes.Last();
                break;

            case AnchorPosition.Nth:
                newTime = anchorTimes[Index];
                break;
            }

            return(new PatternActionResult(newTime));
        }
Esempio n. 2
0
        public PatternActionResult Invoke(long time, PatternContext context)
        {
            var anchorTimes = context.GetAnchorTimes(Anchor);
            var newTime     = 0L;

            switch (AnchorPosition)
            {
            case AnchorPosition.First:
                newTime = anchorTimes.First();
                break;

            case AnchorPosition.Last:
                newTime = anchorTimes.Last();
                break;

            case AnchorPosition.Nth:
                newTime = anchorTimes[Index];
                break;
            }

            return(new PatternActionResult(newTime));
        }