@@ -20,66 +20,79 @@ public TimeSpan ToTimeSpan()
20
20
return TimeSpan . FromSeconds ( Seconds ) ;
21
21
}
22
22
23
+ /// <summary>Get <see cref="DateTime"/> from <see cref="DateTime"/> plus <see cref="Duration"/>.</summary>
23
24
public static DateTime operator + ( DateTime time , Duration duration )
24
25
{
25
26
return time . AddSeconds ( duration . Seconds ) ;
26
27
}
27
28
29
+ /// <summary>Get <see cref="DateTime"/> from <see cref="DateTime"/> minus <see cref="Duration"/>.</summary>
28
30
public static DateTime operator - ( DateTime time , Duration duration )
29
31
{
30
32
return time . AddSeconds ( - duration . Seconds ) ;
31
33
}
32
34
35
+ /// <summary>Explicitly cast <see cref="Duration"/> to <see cref="TimeSpan"/>.</summary>
33
36
public static explicit operator TimeSpan ( Duration duration )
34
37
{
35
38
return duration . ToTimeSpan ( ) ;
36
39
}
37
40
41
+ /// <summary>Explicitly cast <see cref="TimeSpan"/> to <see cref="Duration"/>.</summary>
38
42
public static explicit operator Duration ( TimeSpan duration )
39
43
{
40
44
return FromSeconds ( duration . TotalSeconds ) ;
41
45
}
42
46
47
+ /// <summary>True if <see cref="Duration"/> is less than <see cref="TimeSpan"/>.</summary>
43
48
public static bool operator < ( Duration duration , TimeSpan timeSpan )
44
49
{
45
50
return duration . Seconds < timeSpan . TotalSeconds ;
46
51
}
47
52
53
+ /// <summary>True if <see cref="Duration"/> is greater than <see cref="TimeSpan"/>.</summary>
48
54
public static bool operator > ( Duration duration , TimeSpan timeSpan )
49
55
{
50
56
return duration . Seconds > timeSpan . TotalSeconds ;
51
57
}
52
58
59
+ /// <summary>True if <see cref="Duration"/> is less than or equal to <see cref="TimeSpan"/>.</summary>
53
60
public static bool operator <= ( Duration duration , TimeSpan timeSpan )
54
61
{
55
62
return duration . Seconds <= timeSpan . TotalSeconds ;
56
63
}
57
64
65
+ /// <summary>True if <see cref="Duration"/> is greater than or equal to <see cref="TimeSpan"/>.</summary>
58
66
public static bool operator >= ( Duration duration , TimeSpan timeSpan )
59
67
{
60
68
return duration . Seconds >= timeSpan . TotalSeconds ;
61
69
}
62
70
71
+ /// <summary>True if <see cref="TimeSpan"/> is less than <see cref="Duration"/>.</summary>
63
72
public static bool operator < ( TimeSpan timeSpan , Duration duration )
64
73
{
65
74
return timeSpan . TotalSeconds < duration . Seconds ;
66
75
}
67
76
77
+ /// <summary>True if <see cref="TimeSpan"/> is greater than <see cref="Duration"/>.</summary>
68
78
public static bool operator > ( TimeSpan timeSpan , Duration duration )
69
79
{
70
80
return timeSpan . TotalSeconds > duration . Seconds ;
71
81
}
72
82
83
+ /// <summary>True if <see cref="TimeSpan"/> is less than or equal to <see cref="Duration"/>.</summary>
73
84
public static bool operator <= ( TimeSpan timeSpan , Duration duration )
74
85
{
75
86
return timeSpan . TotalSeconds <= duration . Seconds ;
76
87
}
77
88
89
+ /// <summary>True if <see cref="TimeSpan"/> is greater than or equal to <see cref="Duration"/>.</summary>
78
90
public static bool operator >= ( TimeSpan timeSpan , Duration duration )
79
91
{
80
92
return timeSpan . TotalSeconds >= duration . Seconds ;
81
93
}
82
94
95
+ /// <summary>Get <see cref="Volume"/> from <see cref="Duration"/> times <see cref="VolumeFlow"/>.</summary>
83
96
public static Volume operator * ( Duration duration , VolumeFlow volumeFlow )
84
97
{
85
98
return Volume . FromCubicMeters ( volumeFlow . CubicMetersPerSecond * duration . Seconds ) ;
0 commit comments