Krzysztof Krysiński vor 2 Jahren
Ursprung
Commit
a250a66aea

+ 2 - 0
src/PixiEditor.Platform.MSStore/MicrosoftStorePlatform.cs

@@ -2,6 +2,8 @@
 
 public sealed class MicrosoftStorePlatform : IPlatform
 {
+    public string Name => "Microsoft Store";
+
     public bool PerformHandshake()
     {
         return true;

+ 2 - 0
src/PixiEditor.Platform.Standalone/StandalonePlatform.cs

@@ -2,6 +2,8 @@
 
 public sealed class StandalonePlatform : IPlatform
 {
+    public string Name => "Standalone";
+
     public bool PerformHandshake()
     {
         return true;

+ 2 - 0
src/PixiEditor.Platform.Steam/SteamPlatform.cs

@@ -4,6 +4,8 @@ namespace PixiEditor.Platform.Steam;
 
 public class SteamPlatform : IPlatform
 {
+    public string Name => "Steam";
+
     public bool PerformHandshake()
     {
         try

+ 1 - 0
src/PixiEditor.Platform/IPlatform.cs

@@ -3,6 +3,7 @@
 public interface IPlatform
 {
     public static IPlatform Current { get; private set; }
+    public abstract string Name { get; }
     public bool PerformHandshake();
     public IAdditionalContentProvider? AdditionalContentProvider { get; }
 

+ 2 - 7
src/PixiEditor/ViewModels/SubViewModels/Main/UpdateViewModel.cs

@@ -11,6 +11,7 @@ using PixiEditor.Models.Commands.Attributes.Commands;
 using PixiEditor.Models.Dialogs;
 using PixiEditor.Models.Localization;
 using PixiEditor.Models.UserPreferences;
+using PixiEditor.Platform;
 using PixiEditor.UpdateModule;
 
 namespace PixiEditor.ViewModels.SubViewModels.Main;
@@ -216,13 +217,7 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
         UpdateChannels.Add(new UpdateChannel("Release", "PixiEditor", "PixiEditor"));
         UpdateChannels.Add(new UpdateChannel("Development", "PixiEditor", "PixiEditor-development-channel"));
 #else
-    #if STEAM
-        string platformName = "Steam";
-    #elif MSIX
-        string platformName = "Microsoft Store";
-    #else
-        string platformName = "Unknown";
-    #endif
+        string platformName = IPlatform.Current.Name;
         UpdateChannels.Add(new UpdateChannel(platformName, "", ""));
 #endif