WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
WGetNET.WinGetPackage Class Reference

Represents a winget package. More...

Inheritance diagram for WGetNET.WinGetPackage:
WGetNET.IWinGetObject WGetNET.WinGetPinnedPackage

Public Member Functions

bool SamePackage (WinGetPackage other, bool sameVersion=false)
 Checks if two packages are the same and optionally if they also have the same version.
 
virtual object Clone ()
 
override string ToString ()
 

Static Public Member Functions

static WinGetPackage Create (string name, string id, string version, string sourceName="")
 Creates a new instance of the WGetNET.WinGetPackage class and returns it.
 
static WinGetPackage Create (string name, string id, string version, string availableVersion, string sourceName="")
 Creates a new instance of the WGetNET.WinGetPackage class and returns it.
 
static WinGetPackage Create (string name, string id, Version version, string sourceName="")
 Creates a new instance of the WGetNET.WinGetPackage class and returns it.
 
static WinGetPackage Create (string name, string id, Version version, Version availableVersion, string sourceName="")
 Creates a new instance of the WGetNET.WinGetPackage class and returns it.
 

Properties

string Name [get]
 Gets the name of the package.
 
string Id [get]
 Gets the id of the package.
 
string VersionString [get]
 Gets the version of the package.
 
Version Version [get]
 Gets the version of the package.
 
string AvailableVersionString [get]
 Gets the newest available version of the package.
 
Version AvailableVersion [get]
 Gets the newest available version of the package.
 
string SourceName [get]
 Gets the source name for the package.
 
bool HasShortenedId [get]
 Gets if id of the package is shortened.
 
bool HasNoId [get]
 Gets if the package does not provide an id.
 
bool HasUpgrade [get]
 Gets if the package can be upgraded.
 
bool IsEmpty [get]
 Gets if the object is empty.
 
- Properties inherited from WGetNET.IWinGetObject

Detailed Description

Represents a winget package.

Definition at line 14 of file WinGetPackage.cs.

Member Function Documentation

◆ Clone()

virtual object WGetNET.WinGetPackage.Clone ( )
virtual

Reimplemented in WGetNET.WinGetPinnedPackage.

Definition at line 381 of file WinGetPackage.cs.

◆ Create() [1/4]

static WinGetPackage WGetNET.WinGetPackage.Create ( string name,
string id,
string version,
string availableVersion,
string sourceName = "" )
static

Creates a new instance of the WGetNET.WinGetPackage class and returns it.

Parameters
nameThe name of the package.
idThe id of the package.
versionThe current version of the package as a System.String.
availableVersionThe highest available version of the package as a System.String.
sourceNameThe name of the source the package comes from.
Returns
The created instance of the WGetNET.WinGetPackage class.
Exceptions
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 259 of file WinGetPackage.cs.

◆ Create() [2/4]

static WinGetPackage WGetNET.WinGetPackage.Create ( string name,
string id,
string version,
string sourceName = "" )
static

Creates a new instance of the WGetNET.WinGetPackage class and returns it.

Parameters
nameThe name of the package.
idThe id of the package.
versionThe current version of the package as a System.String. It will also be used for the available version.
sourceNameThe name of the source the package comes from.
Returns
The created instance of the WGetNET.WinGetPackage class.
Exceptions
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 225 of file WinGetPackage.cs.

◆ Create() [3/4]

static WinGetPackage WGetNET.WinGetPackage.Create ( string name,
string id,
Version version,
string sourceName = "" )
static

Creates a new instance of the WGetNET.WinGetPackage class and returns it.

Parameters
nameThe name of the package.
idThe id of the package.
versionThe current version of the package. It will also be used for the available version.
sourceNameThe name of the source the package comes from.
Returns
The created instance of the WGetNET.WinGetPackage class.
Exceptions
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 294 of file WinGetPackage.cs.

◆ Create() [4/4]

static WinGetPackage WGetNET.WinGetPackage.Create ( string name,
string id,
Version version,
Version availableVersion,
string sourceName = "" )
static

Creates a new instance of the WGetNET.WinGetPackage class and returns it.

Parameters
nameThe name of the package.
idThe id of the package.
versionThe current version of the package.
availableVersionThe highest available version of the package.
sourceNameThe name of the source the package comes from.
Returns
The created instance of the WGetNET.WinGetPackage class.
Exceptions
System.ArgumentExceptionA provided argument is empty.
System.ArgumentNullExceptionA provided argument is null.

Definition at line 328 of file WinGetPackage.cs.

◆ SamePackage()

bool WGetNET.WinGetPackage.SamePackage ( WinGetPackage other,
bool sameVersion = false )

Checks if two packages are the same and optionally if they also have the same version.

Parameters
otherThe WGetNET.WinGetPackage to compare with.
sameVersionSet to true to also check for the same version.
Returns
true if both packages are the same and false if not.

Definition at line 359 of file WinGetPackage.cs.

◆ ToString()

override string WGetNET.WinGetPackage.ToString ( )

Definition at line 396 of file WinGetPackage.cs.

Property Documentation

◆ AvailableVersion

Version WGetNET.WinGetPackage.AvailableVersion
get

Gets the newest available version of the package.

Definition at line 74 of file WinGetPackage.cs.

◆ AvailableVersionString

string WGetNET.WinGetPackage.AvailableVersionString
get

Gets the newest available version of the package.

Definition at line 63 of file WinGetPackage.cs.

◆ HasNoId

bool WGetNET.WinGetPackage.HasNoId
get

Gets if the package does not provide an id.

If this is true somthing whent wrong in the creation of the package. The name of the package will be used for all actions performd with this package.

Definition at line 114 of file WinGetPackage.cs.

◆ HasShortenedId

bool WGetNET.WinGetPackage.HasShortenedId
get

Gets if id of the package is shortened.

The name of the package will be used for all actions performd with this package.

Definition at line 99 of file WinGetPackage.cs.

◆ HasUpgrade

bool WGetNET.WinGetPackage.HasUpgrade
get

Gets if the package can be upgraded.

Definition at line 130 of file WinGetPackage.cs.

◆ Id

string WGetNET.WinGetPackage.Id
get

Gets the id of the package.

Definition at line 30 of file WinGetPackage.cs.

◆ IsEmpty

bool WGetNET.WinGetPackage.IsEmpty
get

Gets if the object is empty.

A package object counts as empty if it does not contain a id and name. Because the rest of the information is useless in this state.

Implements WGetNET.IWinGetObject.

Definition at line 150 of file WinGetPackage.cs.

◆ Name

string WGetNET.WinGetPackage.Name
get

Gets the name of the package.

Definition at line 19 of file WinGetPackage.cs.

◆ SourceName

string WGetNET.WinGetPackage.SourceName
get

Gets the source name for the package.

Definition at line 85 of file WinGetPackage.cs.

◆ Version

Version WGetNET.WinGetPackage.Version
get

Gets the version of the package.

Definition at line 52 of file WinGetPackage.cs.

◆ VersionString

string WGetNET.WinGetPackage.VersionString
get

Gets the version of the package.

Definition at line 41 of file WinGetPackage.cs.