public static void TestClone(ITimeSpan timeSpan)
        {
            var clone = timeSpan.Clone();

            Assert.AreEqual(timeSpan, clone, "Clone time span doesn't equal to the original one.");
            Assert.IsFalse(ReferenceEquals(timeSpan, clone), "Clone time span is the same instance as the original one.");
        }
Beispiel #2
0
        public static ITimeSpan ConvertTo(ITimeSpan timeSpan, Type timeSpanType, long time, TempoMap tempoMap)
        {
            if (timeSpan.GetType() == timeSpanType)
            {
                return(timeSpan.Clone());
            }

            return(GetConverter(timeSpanType).ConvertTo(ConvertFrom(timeSpan, time, tempoMap), time, tempoMap));
        }
Beispiel #3
0
        public static ITimeSpan ConvertTo(ITimeSpan timeSpan, TimeSpanType timeSpanType, long time, TempoMap tempoMap)
        {
            if (timeSpan.GetType() == TimeSpansTypes[timeSpanType])
            {
                return(timeSpan.Clone());
            }

            return(ConvertTo(ConvertFrom(timeSpan, time, tempoMap), timeSpanType, time, tempoMap));
        }
Beispiel #4
0
        public static TTimeSpan ConvertTo <TTimeSpan>(ITimeSpan timeSpan, long time, TempoMap tempoMap)
            where TTimeSpan : ITimeSpan
        {
            if (timeSpan is TTimeSpan)
            {
                return((TTimeSpan)timeSpan.Clone());
            }

            return(ConvertTo <TTimeSpan>(ConvertFrom(timeSpan, time, tempoMap), time, tempoMap));
        }