WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
WinGetInfoEntry.cs
1//--------------------------------------------------//
2// Created by basicx-StrgV //
3// https://github.com/basicx-StrgV/ //
4//--------------------------------------------------//
5using System;
6
8{
15 public abstract class WinGetInfoEntry<T> : IWinGetObject, IEquatable<T>, ICloneable where T : WinGetInfoEntry<T>
16 {
20 public string EntryName
21 {
22 get
23 {
24 return _entryName;
25 }
26 }
27
31 public string RawContent
32 {
33 get
34 {
35 return _rawContent;
36 }
37 }
38
43 {
44 get
45 {
46 return _hasShortenedContent;
47 }
48 }
49
53 public virtual bool IsEmpty
54 {
55 get
56 {
57 if (string.IsNullOrWhiteSpace(_entryName) && string.IsNullOrWhiteSpace(_rawContent))
58 {
59 return true;
60 }
61 return false;
62 }
63 }
64
65 // \cond PRIVATE
66 private protected readonly string _entryName;
67 private protected readonly string _rawContent;
68 private protected readonly bool _hasShortenedContent;
69
76 private protected WinGetInfoEntry(string entryName, string rawContent, bool hasShortenedContent)
77 {
78 _entryName = entryName;
79 _rawContent = rawContent;
80 _hasShortenedContent = hasShortenedContent;
81 }
82 // \endcond
83
85 public override string ToString()
86 {
87 return _entryName;
88 }
89
91 public abstract bool Equals(T? other);
92
94 public abstract object Clone();
95 }
96}
Represents a basic winget info entry.
bool HasShortenedContent
Gets if content of the package is shortened.
virtual bool IsEmpty
Gets if the object is empty.
string RawContent
Gets the raw content of the info entry.
string EntryName
Gets the name of the info entry.
Interface for all winget related objects.