Skip to content

Commit

Permalink
Port OSVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter committed Jan 7, 2025
1 parent 546c6ed commit edb9411
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions components/Helpers/src/OSVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace CommunityToolkit.WinUI.Helpers;

/// <summary>
/// Defines Operating System version
/// </summary>
public struct OSVersion
{
/// <summary>
/// Value describing major version
/// </summary>
public ushort Major;

/// <summary>
/// Value describing minor version
/// </summary>
public ushort Minor;

/// <summary>
/// Value describing build
/// </summary>
public ushort Build;

/// <summary>
/// Value describing revision
/// </summary>
public ushort Revision;

/// <summary>
/// Converts OSVersion to string
/// </summary>
/// <returns>Major.Minor.Build.Revision as a string</returns>
public override readonly string ToString()
=> $"{Major}.{Minor}.{Build}.{Revision}";
}

0 comments on commit edb9411

Please sign in to comment.