Skip to content

Commit 4a3f107

Browse files
committed
Added valuecreator, supposed to be used with static using
1 parent c6a3ed2 commit 4a3f107

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
namespace Synercoding.Primitives
2+
{
3+
/// <summary>
4+
/// Class that can be used as a static using to have quick &amp; easy access to values
5+
/// </summary>
6+
/// <example>
7+
/// using static Synercoding.Primitives.ValueCreator;
8+
/// </example>
9+
public static class ValueCreator
10+
{
11+
/// <summary>
12+
/// Create a new <see cref="Value"/> with <see cref="Unit"/> <see cref="Unit.Millimeters"/>
13+
/// </summary>
14+
/// <param name="mm">The amount of mm</param>
15+
/// <returns>A new <see cref="Value"/> object.</returns>
16+
public static Value Mm(double mm) => new Value(mm, Unit.Millimeters);
17+
/// <summary>
18+
/// Create a new <see cref="Value"/> with <see cref="Unit"/> <see cref="Unit.Centimeters"/>
19+
/// </summary>
20+
/// <param name="cm">The amount of cm</param>
21+
/// <returns>A new <see cref="Value"/> object.</returns>
22+
public static Value Cm(double cm) => new Value(cm, Unit.Centimeters);
23+
/// <summary>
24+
/// Create a new <see cref="Value"/> with <see cref="Unit"/> <see cref="Unit.Inches"/>
25+
/// </summary>
26+
/// <param name="inch">The amount of inch</param>
27+
/// <returns>A new <see cref="Value"/> object.</returns>
28+
public static Value Inch(double inch) => new Value(inch, Unit.Inches);
29+
/// <summary>
30+
/// Create a new <see cref="Value"/> with <see cref="Unit"/> <see cref="Unit.Points"/>
31+
/// </summary>
32+
/// <param name="pts">The amount of pts</param>
33+
/// <returns>A new <see cref="Value"/> object.</returns>
34+
public static Value Pts(double pts) => new Value(pts, Unit.Points);
35+
}
36+
}

0 commit comments

Comments
 (0)