WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
PackageHelper.cs
1//--------------------------------------------------//
2// Created by basicx-StrgV //
3// https://github.com/basicx-StrgV/ //
4//--------------------------------------------------//
5using System.Collections.Generic;
6
7namespace WGetNET.Helper
8{
12 internal static class PackageHelper
13 {
26 public static WinGetPackage? MatchExact(List<WinGetPackage> matchList, string matchString)
27 {
28 if (matchList == null || matchList.Count <= 0 || string.IsNullOrWhiteSpace(matchString))
29 {
30 return null;
31 }
32
33 for (int i = 0; i < matchList.Count; i++)
34 {
35 if (string.Equals(matchList[i].Id, matchString) || string.Equals(matchList[i].Name, matchString))
36 {
37 return matchList[i];
38 }
39 }
40
41 return null;
42 }
43 }
44}