Skip to content

Commit 22fae91

Browse files
committed
Added the PinnedVersionObject property to the WinGetPinnedPackage class
1 parent bd31a75 commit 22fae91

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/WGet.NET/Models/WinGetPinnedPackage.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Created by basicx-StrgV //
33
// https://github.com/basicx-StrgV/ //
44
//--------------------------------------------------//
5+
using System;
6+
using WGetNET.HelperClasses;
7+
58
namespace WGetNET
69
{
710
/// <summary>
@@ -31,6 +34,17 @@ public string PinnedVersion
3134
}
3235
}
3336

37+
/// <summary>
38+
/// Gets the pinned version.
39+
/// </summary>
40+
public Version PinnedVersionObject
41+
{
42+
get
43+
{
44+
return _pinnedVersionObject;
45+
}
46+
}
47+
3448
/// <summary>
3549
/// Gets the pin type of the package.
3650
/// </summary>
@@ -60,6 +74,7 @@ public override bool IsEmpty
6074

6175
private readonly string _pinTypeString;
6276
private readonly string _pinnedVersion;
77+
private readonly Version _pinnedVersionObject;
6378
private readonly PinType _pinType;
6479

6580
/// <summary>
@@ -73,6 +88,8 @@ internal WinGetPinnedPackage(string pinType, string pinnedVersion, bool hasShort
7388
_pinTypeString = pinType;
7489
_pinnedVersion = pinnedVersion;
7590

91+
_pinnedVersionObject = VersionParser.Parse(_pinnedVersion);
92+
7693
_pinType = _pinTypeString.ToUpper() switch
7794
{
7895
"PINNING" => PinType.Pinning,

0 commit comments

Comments
 (0)