コード例 #1
0
        public override bool Equals(object obj)
        {
            Iso8601Duration other = obj as Iso8601Duration;

            if (null == other)
            {
                return(false);
            }
            long otherTicks = other.ToTimeSpan().Ticks;
            long ticks      = ToTimeSpan().Ticks;

            return(otherTicks == ticks);
        }
コード例 #2
0
        public static TimeSpan XmlSchemaDurationToTimeSpan(string duration)
        {
            // return SoapDuration.Parse(duration);
            //
            // This would be the .NET built-in helper
            // but I examined the code using Reflector and
            // I don't like it as much as mine.
            // For what it's worth, the SoapDuration Parse method
            // converts years to 360 days,
            // months to 30 days, and ignores weeks

            Iso8601Duration iso8601Duration = Iso8601Duration.Parse(duration);

            return(iso8601Duration.ToTimeSpan());
        }
コード例 #3
0
 public static TimeSpan ToTimeSpan(Iso8601Duration duration)
 {
     return duration.ToTimeSpan();
 }
コード例 #4
0
 public static TimeSpan ToTimeSpan(Iso8601Duration duration)
 {
     return(duration.ToTimeSpan());
 }