WGet.NET 4.4.1
A WinGet wrapper library for .Net.
Loading...
Searching...
No Matches
WinGetDirectory.cs
1//--------------------------------------------------//
2// Created by basicx-StrgV //
3// https://github.com/basicx-StrgV/ //
4//--------------------------------------------------//
5using System.IO;
7
8namespace WGetNET
9{
13 public sealed class WinGetDirectory : WinGetInfoEntry<WinGetDirectory>
14 {
18 public bool Exists
19 {
20 get
21 {
22 return _directoryInfo.Exists;
23 }
24 }
25
29 public string Name
30 {
31 get
32 {
33 return _directoryInfo.Name;
34 }
35 }
36
40 public string FullName
41 {
42 get
43 {
44 return _directoryInfo.FullName;
45 }
46 }
47
51 public DirectoryInfo Info
52 {
53 get
54 {
55 return _directoryInfo;
56 }
57 }
58
59 private readonly DirectoryInfo _directoryInfo;
60
68 internal WinGetDirectory(string entryName, string rawContent, bool hasShortenedContent, DirectoryInfo directoryInfo) : base(entryName, rawContent, hasShortenedContent)
69 {
70 _directoryInfo = directoryInfo;
71 }
72
74 public override bool Equals(WinGetDirectory? other)
75 {
76 if (other == null)
77 {
78 return false;
79 }
80
81 if (ReferenceEquals(this, other))
82 {
83 return true;
84 }
85
86 if (_entryName.Equals(other.EntryName) && _rawContent.Equals(other.RawContent) &&
87 _hasShortenedContent.Equals(other.HasShortenedContent) &&
88 _directoryInfo.Equals(other.Info))
89 {
90 return true;
91 }
92
93 return false;
94 }
95
97 public override object Clone()
98 {
99 return new WinGetDirectory(
100 _entryName,
101 _rawContent,
102 _hasShortenedContent,
103 _directoryInfo
104 );
105 }
106 }
107}
Represents a basic winget info entry.
bool HasShortenedContent
Gets if content of the package is shortened.
string RawContent
Gets the raw content of the info entry.
string EntryName
Gets the name of the info entry.
Represents a winget directory in the info set.
override bool Equals(WinGetDirectory? other)
override object Clone()
string FullName
Gets the full path of the directory.
DirectoryInfo Info
Gets the direcory info instance.
string Name
Gets the name of the directory.
bool Exists
Gets a value indicating whether the directory exists.