You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.5 KiB
54 lines
2.5 KiB
1 year ago
|
using Octokit;
|
||
1 year ago
|
using StabilityMatrix.Core.Models.Progress;
|
||
2 years ago
|
|
||
1 year ago
|
namespace StabilityMatrix.Core.Models.Packages;
|
||
2 years ago
|
|
||
|
public abstract class BasePackage
|
||
|
{
|
||
1 year ago
|
public string ByAuthor => $"By {Author}";
|
||
|
|
||
1 year ago
|
public abstract string Name { get; }
|
||
|
public abstract string DisplayName { get; set; }
|
||
2 years ago
|
public abstract string Author { get; }
|
||
2 years ago
|
public abstract string GithubUrl { get; }
|
||
2 years ago
|
public abstract string LaunchCommand { get; }
|
||
1 year ago
|
public abstract Uri PreviewImageUri { get; }
|
||
1 year ago
|
public virtual bool ShouldIgnoreReleases => false;
|
||
2 years ago
|
public virtual bool UpdateAvailable { get; set; }
|
||
1 year ago
|
|
||
|
public abstract Task<string?> DownloadPackage(string version, bool isCommitHash,
|
||
|
IProgress<ProgressReport>? progress = null);
|
||
|
public abstract Task InstallPackage(IProgress<ProgressReport>? progress = null);
|
||
2 years ago
|
public abstract Task RunPackage(string installedPackagePath, string arguments);
|
||
|
public abstract Task Shutdown();
|
||
1 year ago
|
public abstract Task<bool> CheckForUpdates(string installedPackageName);
|
||
1 year ago
|
public abstract Task<string> Update(InstalledPackage installedPackage, IProgress<ProgressReport>? progress = null);
|
||
1 year ago
|
public abstract Task<IOrderedEnumerable<Release>> GetReleaseTags();
|
||
1 year ago
|
|
||
1 year ago
|
public abstract List<LaunchOptionDefinition> LaunchOptions { get; }
|
||
1 year ago
|
public virtual string? ExtraLaunchArguments { get; set; } = null;
|
||
|
|
||
1 year ago
|
/// <summary>
|
||
|
/// The shared folders that this package supports.
|
||
|
/// Mapping of <see cref="SharedFolderType"/> to the relative path from the package root.
|
||
|
/// </summary>
|
||
|
public virtual Dictionary<SharedFolderType, string>? SharedFolders { get; }
|
||
|
|
||
1 year ago
|
public abstract Task<string> GetLatestVersion();
|
||
|
public abstract Task<IEnumerable<PackageVersion>> GetAllVersions(bool isReleaseMode = true);
|
||
1 year ago
|
public abstract Task<IReadOnlyList<GitHubCommit>?> GetAllCommits(string branch, int page = 1, int perPage = 10);
|
||
|
public abstract Task<IReadOnlyList<Branch>> GetAllBranches();
|
||
|
public abstract Task<IOrderedEnumerable<Release>> GetAllReleases();
|
||
2 years ago
|
|
||
1 year ago
|
public abstract string DownloadLocation { get; }
|
||
1 year ago
|
public abstract string InstallLocation { get; set; }
|
||
2 years ago
|
|
||
2 years ago
|
public event EventHandler<string>? ConsoleOutput;
|
||
|
public event EventHandler<int>? Exited;
|
||
2 years ago
|
public event EventHandler<string>? StartupComplete;
|
||
2 years ago
|
|
||
1 year ago
|
public void OnConsoleOutput(string? output) => ConsoleOutput?.Invoke(this, output);
|
||
2 years ago
|
public void OnExit(int exitCode) => Exited?.Invoke(this, exitCode);
|
||
2 years ago
|
public void OnStartupComplete(string url) => StartupComplete?.Invoke(this, url);
|
||
2 years ago
|
}
|