Repository navigation
Expand file tree
/
Copy pathNullPackageManager.cs
More file actions
162 lines (137 loc) · 5.83 KB
/
Copy pathNullPackageManager.cs
File metadata and controls
162 lines (137 loc) · 5.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
using System.Text;
using UniGetUI.Core.IconEngine;
using UniGetUI.Core.Tools;
using UniGetUI.Interface.Enums;
using UniGetUI.PackageEngine.Classes.Manager.Classes;
using UniGetUI.PackageEngine.Classes.Manager.ManagerHelpers;
using UniGetUI.PackageEngine.Enums;
using UniGetUI.PackageEngine.Interfaces;
using UniGetUI.PackageEngine.Interfaces.ManagerProviders;
using UniGetUI.PackageEngine.ManagerClasses.Classes;
using UniGetUI.PackageEngine.ManagerClasses.Manager;
using UniGetUI.PackageEngine.PackageClasses;
using UniGetUI.PackageEngine.Serializable;
namespace UniGetUI.PackageEngine.Classes.Manager
{
public class NullPackageManager : IPackageManager
{
public static NullPackageManager Instance = new();
public ManagerProperties Properties { get; }
public ManagerCapabilities Capabilities { get; }
public ManagerStatus Status { get; }
public Encoding OutputEncoding => Encoding.UTF8;
public string Id
{
get => string.IsNullOrWhiteSpace(Properties.Id) ? Properties.Name : Properties.Id;
}
public string Name
{
get => Properties.Name;
}
public string DisplayName
{
get => Properties.DisplayName ?? Properties.Name;
}
public IManagerSource DefaultSource
{
get => Properties.DefaultSource;
}
public bool ManagerReady
{
get => true;
}
public IManagerLogger TaskLogger { get; }
public IMultiSourceHelper SourcesHelper { get; }
public IPackageDetailsHelper DetailsHelper { get; }
public IPackageOperationHelper OperationHelper { get; }
public IReadOnlyList<ManagerDependency> Dependencies { get; }
public NullPackageManager()
{
TaskLogger = new ManagerLogger(this);
var nullsource = NullSource.Instance;
SourcesHelper = new NullSourceHelper();
DetailsHelper = new NullPkgDetailsHelper();
OperationHelper = new NullPkgOperationHelper();
Properties = new ManagerProperties
{
IsDummy = true,
Id = "unknown",
Name = CoreTools.Translate("Unknown"),
Description = "Unset",
IconId = IconType.Help,
ColorIconId = "Unset",
ExecutableFriendlyName = "Unset",
InstallVerb = "Unset",
UpdateVerb = "Unset",
UninstallVerb = "Unset",
KnownSources = [nullsource],
DefaultSource = nullsource,
};
Capabilities = new ManagerCapabilities();
Status = new ManagerStatus
{
ExecutablePath = "C:/file.exe",
ExecutableCallArgs = "Unset",
Found = false,
Version = "0",
};
Dependencies = [];
}
public IReadOnlyList<IPackage> FindPackages(string query) =>
throw new NotImplementedException();
public IReadOnlyList<IPackage> GetAvailableUpdates() => throw new NotImplementedException();
public IReadOnlyList<IPackage> GetInstalledPackages() =>
throw new NotImplementedException();
public void Initialize() => throw new NotImplementedException();
public bool IsEnabled() => throw new NotImplementedException();
public bool IsReady() => throw new NotImplementedException();
public void RefreshPackageIndexes() => throw new NotImplementedException();
public void AttemptFastRepair() => throw new NotImplementedException();
public IReadOnlyList<string> FindCandidateExecutableFiles() =>
throw new NotImplementedException();
public Tuple<bool, string> GetExecutableFile() => throw new NotImplementedException();
}
internal sealed class NullSourceHelper : IMultiSourceHelper
{
public ISourceFactory Factory => throw new NotImplementedException();
public string[] GetAddSourceParameters(IManagerSource source) =>
throw new NotImplementedException();
public string[] GetRemoveSourceParameters(IManagerSource source) =>
throw new NotImplementedException();
public OperationVeredict GetAddOperationVeredict(
IManagerSource source,
int ReturnCode,
string[] Output
) => throw new NotImplementedException();
public OperationVeredict GetRemoveOperationVeredict(
IManagerSource source,
int ReturnCode,
string[] Output
) => throw new NotImplementedException();
public IReadOnlyList<IManagerSource> GetSources() => throw new NotImplementedException();
}
internal sealed class NullPkgDetailsHelper : IPackageDetailsHelper
{
public void GetDetails(IPackageDetails details) => throw new NotImplementedException();
public IReadOnlyList<string> GetVersions(IPackage package) =>
throw new NotImplementedException();
public CacheableIcon? GetIcon(IPackage package) => throw new NotImplementedException();
public IReadOnlyList<Uri> GetScreenshots(IPackage package) =>
throw new NotImplementedException();
public string? GetInstallLocation(IPackage package) => throw new NotImplementedException();
}
internal sealed class NullPkgOperationHelper : IPackageOperationHelper
{
public IReadOnlyList<string> GetParameters(
IPackage package,
InstallOptions options,
OperationType operation
) => throw new NotImplementedException();
public OperationVeredict GetResult(
IPackage package,
OperationType operation,
IReadOnlyList<string> processOutput,
int returnCode
) => throw new NotImplementedException();
}
}