-
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into user-pfp-discord-rpc
- Loading branch information
Showing
29 changed files
with
435 additions
and
201 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Microsoft.Win32; | ||
|
||
namespace Bloxstrap.Extensions | ||
{ | ||
public static class RegistryKeyEx | ||
{ | ||
public static void SetValueSafe(this RegistryKey registryKey, string? name, object value) | ||
{ | ||
try | ||
{ | ||
App.Logger.WriteLine("RegistryKeyEx::SetValueSafe", $"Writing '{value}' to {registryKey}\\{name}"); | ||
registryKey.SetValue(name, value); | ||
} | ||
catch (UnauthorizedAccessException) | ||
{ | ||
Frontend.ShowMessageBox(Strings.Dialog_RegistryWriteError, System.Windows.MessageBoxImage.Error); | ||
App.Terminate(ErrorCode.ERROR_INSTALL_FAILURE); | ||
} | ||
} | ||
} | ||
} |
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,11 @@ | ||
namespace Bloxstrap.Models.APIs.Config | ||
{ | ||
public class SupporterGroup | ||
{ | ||
[JsonPropertyName("columns")] | ||
public int Columns { get; set; } = 0; | ||
|
||
[JsonPropertyName("supporters")] | ||
public List<Supporter> Supporters { get; set; } = Enumerable.Empty<Supporter>().ToList(); | ||
} | ||
} |
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,42 @@ | ||
using System.Reflection; | ||
using System.Windows.Markup; | ||
|
||
namespace Bloxstrap.Models.SettingTasks | ||
{ | ||
public class ExtractIconsTask : BoolBaseTask | ||
{ | ||
public ExtractIconsTask() : base("ExtractIcons") | ||
{ | ||
OriginalState = Directory.Exists(Paths.Icons); | ||
} | ||
|
||
public override void Execute() | ||
{ | ||
if (NewState) | ||
{ | ||
Directory.CreateDirectory(Paths.Icons); | ||
|
||
var assembly = Assembly.GetExecutingAssembly(); | ||
var resourceNames = assembly.GetManifestResourceNames().Where(x => x.EndsWith(".ico")); | ||
|
||
foreach (string name in resourceNames) | ||
{ | ||
string path = Path.Combine(Paths.Icons, name.Replace("Bloxstrap.Resources.", "")); | ||
var stream = assembly.GetManifestResourceStream(name)!; | ||
|
||
using var memoryStream = new MemoryStream(); | ||
stream.CopyTo(memoryStream); | ||
|
||
Filesystem.AssertReadOnly(path); | ||
File.WriteAllBytes(path, memoryStream.ToArray()); | ||
} | ||
} | ||
else if (Directory.Exists(Paths.Icons)) | ||
{ | ||
Directory.Delete(Paths.Icons, true); | ||
} | ||
|
||
OriginalState = NewState; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.