Skip to content

Commit 451006b

Browse files
committed
Port OSVersion
1 parent c0018dd commit 451006b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

components/Helpers/src/OSVersion.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace CommunityToolkit.WinUI.Helpers;
6+
7+
/// <summary>
8+
/// Defines Operating System version
9+
/// </summary>
10+
public struct OSVersion
11+
{
12+
/// <summary>
13+
/// Value describing major version
14+
/// </summary>
15+
public ushort Major;
16+
17+
/// <summary>
18+
/// Value describing minor version
19+
/// </summary>
20+
public ushort Minor;
21+
22+
/// <summary>
23+
/// Value describing build
24+
/// </summary>
25+
public ushort Build;
26+
27+
/// <summary>
28+
/// Value describing revision
29+
/// </summary>
30+
public ushort Revision;
31+
32+
/// <summary>
33+
/// Converts OSVersion to string
34+
/// </summary>
35+
/// <returns>Major.Minor.Build.Revision as a string</returns>
36+
public override readonly string ToString()
37+
=> $"{Major}.{Minor}.{Build}.{Revision}";
38+
}

0 commit comments

Comments
 (0)