Beispiel #1
0
        /// <summary>
        /// Process all information that occured until now
        /// </summary>

        public void SeekAlignedToLastTick(TimeSpan offset, TimeSeekOrigin origin)
        {
            // IF YOU CHANGE THIS CODE:
            // This code is very similar to that in Seek and is duplicated
            // in each method so that exceptions will be thrown from the public
            // method the user has called. You probably need to change both methods.

            if (!TimeEnumHelper.IsValidTimeSeekOrigin(origin))
            {
                throw new InvalidEnumArgumentException(SR.Get(SRID.Enum_Invalid, "TimeSeekOrigin"));
            }

            if (origin == TimeSeekOrigin.Duration)
            {
                Duration duration = _owner.ResolvedDuration;

                if (!duration.HasTimeSpan)
                {
                    // Can't seek relative to the Duration if it has been specified as Forevor or if
                    // it has not yet been resolved.
                    throw new InvalidOperationException(SR.Get(SRID.Timing_SeekDestinationIndefinite));
                }
                else
                {
                    offset = offset + duration.TimeSpan;
                }
            }

            // Any offset greater than zero is OK here. If it's past the effective
            // duration it means execute the FillBehavior.
            if (offset < TimeSpan.Zero)
            {
                throw new InvalidOperationException(SR.Get(SRID.Timing_SeekDestinationNegative));
            }

            _owner.InternalSeekAlignedToLastTick(offset);
        }
Beispiel #2
0
 private static bool ValidateFillBehavior(object value)
 {
     return(TimeEnumHelper.IsValidFillBehavior((FillBehavior)value));
 }
Beispiel #3
0
 private static bool ValidateSlipBehavior(object value)
 {
     return(TimeEnumHelper.IsValidSlipBehavior((SlipBehavior)value));
 }