-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amethyst task scheduler 😳 (startup/shutdown, update/delete)
- Loading branch information
1 parent
9c5cda7
commit cdd6a88
Showing
15 changed files
with
631 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using Amethyst.Classes; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Amethyst.MVVM; | ||
|
||
public class StorePlugin : INotifyPropertyChanged | ||
{ | ||
public string Name { get; set; } | ||
public bool Official { get; set; } = false; | ||
|
||
public bool Installing { get; set; } = false; | ||
public bool InstallSuccess { get; set; } = false; | ||
public bool InstallError { get; set; } = false; | ||
|
||
public IEnumerable<Contributor> Contributors { get; set; } | ||
public PluginRepository Repository { get; set; } | ||
public PluginRelease LatestRelease { get; set; } | ||
|
||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
// MVVM stuff | ||
public string TrimString(string s, int l) | ||
{ | ||
return s?[..Math.Min(s.Length, l)] + | ||
(s?.Length > l ? "..." : ""); | ||
} | ||
|
||
public double BoolToOpacity(bool value) | ||
{ | ||
return value ? 1.0 : 0.0; | ||
} | ||
|
||
public void OnPropertyChanged(string propName = null) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName)); | ||
} | ||
|
||
public string FormatResourceString(string resourceName) | ||
{ | ||
return string.Format(Interfacing.LocalizedJsonString(resourceName), Name); | ||
} | ||
|
||
public class PluginRepository | ||
{ | ||
public string Name { get; set; } | ||
public string FullName { get; set; } |