WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
WinGetInfo.cs
1//--------------------------------------------------//
2// Created by basicx-StrgV //
3// https://github.com/basicx-StrgV/ //
4//--------------------------------------------------//
5using System;
6using System.Collections.Generic;
7using System.Collections.ObjectModel;
8
9namespace WGetNET
10{
14 public sealed class WinGetInfo : IWinGetObject
15 {
19 public string VersionString
20 {
21 get
22 {
23 return _versionString;
24 }
25 }
26
31 {
32 get
33 {
34 return _version;
35 }
36 }
37
41 public ReadOnlyCollection<WinGetDirectory> Directories
42 {
43 get
44 {
45 return _directories;
46 }
47 }
48
52 public ReadOnlyCollection<WinGetLink> Links
53 {
54 get
55 {
56 return _links;
57 }
58 }
59
63 public ReadOnlyCollection<WinGetAdminSetting> AdminSettings
64 {
65 get
66 {
67 return _adminSettings;
68 }
69 }
70
74 public bool IsEmpty
75 {
76 get
77 {
78 if (string.IsNullOrWhiteSpace(_versionString) &&
79 (_directories == null || _directories.Count <= 0) &&
80 (_links == null || _links.Count <= 0) &&
81 (_adminSettings == null || _adminSettings.Count <= 0))
82 {
83 return true;
84 }
85 return false;
86 }
87 }
88
92 internal static WinGetInfo Empty
93 {
94 get
95 {
96 return new WinGetInfo("", new Version(0, 0), new List<WinGetDirectory>(), new List<WinGetLink>(), new List<WinGetAdminSetting>());
97 }
98 }
99
100 private readonly string _versionString;
101 private readonly Version _version;
102 private readonly ReadOnlyCollection<WinGetDirectory> _directories;
103 private readonly ReadOnlyCollection<WinGetLink> _links;
104 private readonly ReadOnlyCollection<WinGetAdminSetting> _adminSettings;
105
120 internal WinGetInfo(string versionString, Version version, List<WinGetDirectory> directories, List<WinGetLink> links, List<WinGetAdminSetting> adminSettings)
121 {
122 _versionString = versionString;
123 _version = version;
124 _directories = new ReadOnlyCollection<WinGetDirectory>(directories);
125 _links = new ReadOnlyCollection<WinGetLink>(links);
126 _adminSettings = new ReadOnlyCollection<WinGetAdminSetting>(adminSettings);
127 }
128 }
129}
Represents winget related information.
Definition WinGetInfo.cs:15
ReadOnlyCollection< WinGetDirectory > Directories
Gets a collection of the winget direcories.
Definition WinGetInfo.cs:42
ReadOnlyCollection< WinGetLink > Links
Gets a collection of the winget related links.
Definition WinGetInfo.cs:53
bool IsEmpty
Gets if the object is empty.
Definition WinGetInfo.cs:75
ReadOnlyCollection< WinGetAdminSetting > AdminSettings
Gets a collection of the winget admin settings.
Definition WinGetInfo.cs:64
Version Version
Gets the version number of the winget installation.
Definition WinGetInfo.cs:31
string VersionString
Gets the version number of the winget installation as a System.String.
Definition WinGetInfo.cs:20
Interface for all winget related objects.