forked from ElectronNET/Electron.NET
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTimeSpanExtensions.cs
More file actions
74 lines (62 loc) · 2.07 KB
/
Copy pathTimeSpanExtensions.cs
File metadata and controls
74 lines (62 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// <copyright file="TimeSpanExtensions.cs" company="Emby LLC">
// Copyright © Emby LLC. All rights reserved.
// </copyright>
namespace ElectronNET.Common
{
using System;
using System.Diagnostics.CodeAnalysis;
/// <summary>
/// The TimeSpanExtensions class.
/// </summary>
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "OK")]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1600:Elements should be documented", Justification = "OK")]
[SuppressMessage("ReSharper", "StyleCop.SA1300", Justification = "OK")]
[SuppressMessage("ReSharper", "InconsistentNaming", Justification = "OK")]
internal static class TimeSpanExtensions
{
public static TimeSpan ms(this int value)
{
return TimeSpan.FromMilliseconds(value);
}
public static TimeSpan ms(this long value)
{
return TimeSpan.FromMilliseconds(value);
}
public static TimeSpan seconds(this int value)
{
return TimeSpan.FromSeconds(value);
}
public static TimeSpan minutes(this int value)
{
return TimeSpan.FromMinutes(value);
}
public static TimeSpan hours(this int value)
{
return TimeSpan.FromHours(value);
}
public static TimeSpan days(this int value)
{
return TimeSpan.FromDays(value);
}
public static TimeSpan ms(this double value)
{
return TimeSpan.FromMilliseconds(value);
}
public static TimeSpan seconds(this double value)
{
return TimeSpan.FromSeconds(value);
}
public static TimeSpan minutes(this double value)
{
return TimeSpan.FromMinutes(value);
}
public static TimeSpan hours(this double value)
{
return TimeSpan.FromHours(value);
}
public static TimeSpan days(this double value)
{
return TimeSpan.FromDays(value);
}
}
}