From 25c10e86383a104d945a941091acacd21006de9e Mon Sep 17 00:00:00 2001 From: 4sval Date: Sun, 18 Jun 2023 02:34:54 +0200 Subject: [PATCH] that's the way --- CUE4Parse | 2 +- FModel/MainWindow.xaml | 4 +- FModel/MainWindow.xaml.cs | 4 +- FModel/Settings/CustomDirectory.cs | 54 +++++++++++++++ FModel/Settings/DirectorySettings.cs | 65 ++++++++++++------- .../EndpointSettings.cs} | 25 +++++-- FModel/Settings/UserSettings.cs | 34 +--------- FModel/Settings/VersioningSettings.cs | 2 + FModel/ViewModels/CUE4ParseViewModel.cs | 5 -- .../Commands/AddEditDirectoryCommand.cs | 3 +- .../Commands/DeleteDirectoryCommand.cs | 3 +- .../ViewModels/CustomDirectoriesViewModel.cs | 31 --------- FModel/ViewModels/GameSelectorViewModel.cs | 46 +++---------- FModel/ViewModels/SettingsViewModel.cs | 8 +-- FModel/Views/CustomDir.xaml.cs | 6 +- .../Resources/Controls/EndpointEditor.xaml.cs | 14 ++-- 16 files changed, 149 insertions(+), 157 deletions(-) create mode 100644 FModel/Settings/CustomDirectory.cs rename FModel/{Framework/FEndpoint.cs => Settings/EndpointSettings.cs} (73%) diff --git a/CUE4Parse b/CUE4Parse index fb4e3d5f..3d99ba8f 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit fb4e3d5f2fcae1b761dee4eed311a1b132ac5735 +Subproject commit 3d99ba8f8ee84d2052403858d5657f9015a5d2ab diff --git a/FModel/MainWindow.xaml b/FModel/MainWindow.xaml index 3db666be..7def5915 100644 --- a/FModel/MainWindow.xaml +++ b/FModel/MainWindow.xaml @@ -94,7 +94,7 @@ - + @@ -396,7 +396,7 @@ - + diff --git a/FModel/MainWindow.xaml.cs b/FModel/MainWindow.xaml.cs index 41850e26..43bad02d 100644 --- a/FModel/MainWindow.xaml.cs +++ b/FModel/MainWindow.xaml.cs @@ -228,13 +228,13 @@ public partial class MainWindow } } - private void OnSaveDirectoryClick(object sender, RoutedEventArgs e) + private void OnFavoriteDirectoryClick(object sender, RoutedEventArgs e) { if (AssetsFolderName.SelectedItem is not TreeItem folder) return; _applicationView.CustomDirectories.Add(new CustomDirectory(folder.Header, folder.PathAtThisPoint)); FLogger.Append(ELog.Information, () => - FLogger.Text($"Successfully saved '{folder.PathAtThisPoint}' as a new custom directory", Constants.WHITE, true)); + FLogger.Text($"Successfully saved '{folder.PathAtThisPoint}' as a new favorite directory", Constants.WHITE, true)); } private void OnCopyDirectoryPathClick(object sender, RoutedEventArgs e) diff --git a/FModel/Settings/CustomDirectory.cs b/FModel/Settings/CustomDirectory.cs new file mode 100644 index 00000000..d04953f9 --- /dev/null +++ b/FModel/Settings/CustomDirectory.cs @@ -0,0 +1,54 @@ +using System.Collections.Generic; +using FModel.Framework; + +namespace FModel.Settings; + +public class CustomDirectory : ViewModel +{ + public static IList Default(string gameName) + { + switch (gameName) + { + case "Fortnite": + case "Fortnite [LIVE]": + return new List + { + new("Cosmetics", "FortniteGame/Content/Athena/Items/Cosmetics/"), + new("Emotes [AUDIO]", "FortniteGame/Content/Athena/Sounds/Emotes/"), + new("Music Packs [AUDIO]", "FortniteGame/Content/Athena/Sounds/MusicPacks/"), + new("Weapons", "FortniteGame/Content/Athena/Items/Weapons/"), + new("Strings", "FortniteGame/Content/Localization/") + }; + default: + return new List(); + } + } + + private string _header; + public string Header + { + get => _header; + set => SetProperty(ref _header, value); + } + + private string _directoryPath; + public string DirectoryPath + { + get => _directoryPath; + set => SetProperty(ref _directoryPath, value); + } + + public CustomDirectory() + { + Header = string.Empty; + DirectoryPath = string.Empty; + } + + public CustomDirectory(string header, string path) + { + Header = header; + DirectoryPath = path; + } + + public override string ToString() => Header; +} diff --git a/FModel/Settings/DirectorySettings.cs b/FModel/Settings/DirectorySettings.cs index 6023cec4..1fc73451 100644 --- a/FModel/Settings/DirectorySettings.cs +++ b/FModel/Settings/DirectorySettings.cs @@ -3,13 +3,30 @@ using System.Collections.Generic; using CUE4Parse.UE4.Assets.Exports.Texture; using CUE4Parse.UE4.Versions; using FModel.Framework; -using FModel.ViewModels; using FModel.ViewModels.ApiEndpoints.Models; namespace FModel.Settings; public class DirectorySettings : ViewModel { + public static DirectorySettings Default( + string gameName, string gameDir, bool manual = false, EGame ue = EGame.GAME_UE4_LATEST, + ETexturePlatform texture = ETexturePlatform.DesktopMobile, VersioningSettings ver = null) + { + UserSettings.Default.PerDirectory.TryGetValue(gameDir, out var old); + return new DirectorySettings + { + GameName = gameName, + GameDirectory = gameDir, + IsManual = manual, + UeVersion = ue, + TexturePlatform = texture, + Versioning = ver ?? new VersioningSettings(), + Endpoints = old?.Endpoints ?? EndpointSettings.Default(gameName), + Directories = old?.Directories ?? CustomDirectory.Default(gameName) + }; + } + private string _gameName; public string GameName { @@ -31,20 +48,41 @@ public class DirectorySettings : ViewModel set => SetProperty(ref _isManual, value); } - private EGame _ueVersion = EGame.GAME_UE4_LATEST; + private EGame _ueVersion; public EGame UeVersion { get => _ueVersion; set => SetProperty(ref _ueVersion, value); } - private ETexturePlatform _texturePlatform = ETexturePlatform.DesktopMobile; + private ETexturePlatform _texturePlatform; public ETexturePlatform TexturePlatform { get => _texturePlatform; set => SetProperty(ref _texturePlatform, value); } + private VersioningSettings _versioning; + public VersioningSettings Versioning + { + get => _versioning; + set => SetProperty(ref _versioning, value); + } + + private EndpointSettings[] _endpoints; + public EndpointSettings[] Endpoints + { + get => _endpoints; + set => SetProperty(ref _endpoints, value); + } + + private IList _directories; + public IList Directories + { + get => _directories; + set => SetProperty(ref _directories, value); + } + private AesResponse _aesKeys; public AesResponse AesKeys { @@ -52,27 +90,6 @@ public class DirectorySettings : ViewModel set => SetProperty(ref _aesKeys, value); } - private VersioningSettings _versioning = new (); - public VersioningSettings Versioning - { - get => _versioning; - set => SetProperty(ref _versioning, value); - } - - private FEndpoint[] _endpoints = { new (), new () }; - public FEndpoint[] Endpoints - { - get => _endpoints; - set => SetProperty(ref _endpoints, value); - } - - private IList _directories = new List(); - public IList Directories - { - get => _directories; - set => SetProperty(ref _directories, value); - } - private bool Equals(DirectorySettings other) { return GameDirectory == other.GameDirectory && UeVersion == other.UeVersion; diff --git a/FModel/Framework/FEndpoint.cs b/FModel/Settings/EndpointSettings.cs similarity index 73% rename from FModel/Framework/FEndpoint.cs rename to FModel/Settings/EndpointSettings.cs index cd80f109..9f0bd641 100644 --- a/FModel/Framework/FEndpoint.cs +++ b/FModel/Settings/EndpointSettings.cs @@ -1,12 +1,29 @@ using System.Linq; +using FModel.Framework; using FModel.ViewModels.ApiEndpoints; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -namespace FModel.Framework; +namespace FModel.Settings; -public class FEndpoint : ViewModel +public class EndpointSettings : ViewModel { + public static EndpointSettings[] Default(string gameName) + { + switch (gameName) + { + case "Fortnite": + case "Fortnite [LIVE]": + return new EndpointSettings[] + { + new("https://fortnitecentral.genxgames.gg/api/v1/aes", "$.['mainKey','dynamicKeys']"), + new("https://fortnitecentral.genxgames.gg/api/v1/mappings", "$.[?(@.meta.compressionMethod=='Oodle')].['url','fileName']") + }; + default: + return new EndpointSettings[] { new(), new() }; + } + } + private string _url; public string Url { @@ -51,8 +68,8 @@ public class FEndpoint : ViewModel "Your endpoint configuration is valid! Please, avoid any unnecessary modifications!" : "Your endpoint configuration DOES NOT seem to be valid yet! Please, test it out!"; - public FEndpoint() {} - public FEndpoint(string url, string path) + public EndpointSettings() {} + public EndpointSettings(string url, string path) { Url = url; Path = path; diff --git a/FModel/Settings/UserSettings.cs b/FModel/Settings/UserSettings.cs index 617d40e2..07e16b28 100644 --- a/FModel/Settings/UserSettings.cs +++ b/FModel/Settings/UserSettings.cs @@ -42,7 +42,7 @@ namespace FModel.Settings if (File.Exists(FilePath)) File.Delete(FilePath); } - public static bool IsEndpointValid(EEndpointType type, out FEndpoint endpoint) + public static bool IsEndpointValid(EEndpointType type, out EndpointSettings endpoint) { endpoint = Default.CurrentDir.Endpoints[(int) type]; return endpoint.Overwrite || endpoint.IsValid; @@ -253,38 +253,6 @@ namespace FModel.Settings set => SetProperty(ref _manualGames, value); } - private IDictionary _customEndpoints = new Dictionary - { - {FGame.Unknown, new FEndpoint[]{new (), new ()}}, - { - FGame.FortniteGame, new [] - { - new FEndpoint("https://fortnitecentral.genxgames.gg/api/v1/aes", "$.['mainKey','dynamicKeys']"), - new FEndpoint("https://fortnitecentral.genxgames.gg/api/v1/mappings", "$.[?(@.meta.compressionMethod=='Oodle')].['url','fileName']") // && @.meta.platform=='Windows' - } - }, - {FGame.ShooterGame, new FEndpoint[]{new (), new ()}}, - {FGame.DeadByDaylight, new FEndpoint[]{new (), new ()}}, - {FGame.OakGame, new FEndpoint[]{new (), new ()}}, - {FGame.Dungeons, new FEndpoint[]{new (), new ()}}, - {FGame.WorldExplorers, new FEndpoint[]{new (), new ()}}, - {FGame.g3, new FEndpoint[]{new (), new ()}}, - {FGame.StateOfDecay2, new FEndpoint[]{new (), new ()}}, - {FGame.Prospect, new FEndpoint[]{new (), new ()}}, - {FGame.Indiana, new FEndpoint[]{new (), new ()}}, - {FGame.RogueCompany, new FEndpoint[]{new (), new ()}}, - {FGame.SwGame, new FEndpoint[]{new (), new ()}}, - {FGame.Platform, new FEndpoint[]{new (), new ()}}, - {FGame.BendGame, new FEndpoint[]{new (), new ()}}, - {FGame.TslGame, new FEndpoint[]{new (), new ()}}, - {FGame.PortalWars, new FEndpoint[]{new (), new ()}}, - {FGame.Gameface, new FEndpoint[]{new (), new ()}}, - {FGame.Athena, new FEndpoint[]{new (), new ()}}, - {FGame.MultiVersus, new FEndpoint[]{new (), new ()}}, - {FGame.Hotta, new FEndpoint[]{new (), new ()}}, - {FGame.eFootball, new FEndpoint[]{new (), new ()}} - }; - private IDictionary> _customDirectories = new Dictionary> { {FGame.Unknown, new List()}, diff --git a/FModel/Settings/VersioningSettings.cs b/FModel/Settings/VersioningSettings.cs index 6092e5b3..e6ecec91 100644 --- a/FModel/Settings/VersioningSettings.cs +++ b/FModel/Settings/VersioningSettings.cs @@ -26,4 +26,6 @@ public class VersioningSettings : ViewModel get => _mapStructTypes; set => SetProperty(ref _mapStructTypes, value); } + + public VersioningSettings() {} } diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index b2061531..65f6c7fb 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -170,11 +170,6 @@ public class CUE4ParseViewModel : ViewModel break; } } - if (Game == FGame.FortniteGame) currentDir.Endpoints = new[] - { - new FEndpoint("https://fortnitecentral.genxgames.gg/api/v1/aes", "$.['mainKey','dynamicKeys']"), - new FEndpoint("https://fortnitecentral.genxgames.gg/api/v1/mappings", "$.[?(@.meta.compressionMethod=='Oodle')].['url','fileName']") - }; Provider.ReadScriptData = UserSettings.Default.ReadScriptData; GameDirectory = new GameDirectoryViewModel(); diff --git a/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs b/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs index 8258bfba..4ed647d4 100644 --- a/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs +++ b/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs @@ -1,5 +1,6 @@ using AdonisUI.Controls; using FModel.Framework; +using FModel.Settings; using FModel.Views; namespace FModel.ViewModels.Commands; @@ -31,4 +32,4 @@ public class AddEditDirectoryCommand : ViewModelCommand _header; - set => SetProperty(ref _header, value); - } - - private string _directoryPath; - public string DirectoryPath - { - get => _directoryPath; - set => SetProperty(ref _directoryPath, value); - } - - public CustomDirectory() - { - Header = string.Empty; - DirectoryPath = string.Empty; - } - - public CustomDirectory(string header, string path) - { - Header = header; - DirectoryPath = path; - } - - public override string ToString() => Header; -} - public class CustomDirectoriesViewModel : ViewModel { private GoToCommand _goToCommand; diff --git a/FModel/ViewModels/GameSelectorViewModel.cs b/FModel/ViewModels/GameSelectorViewModel.cs index bbf4f447..108abf8a 100644 --- a/FModel/ViewModels/GameSelectorViewModel.cs +++ b/FModel/ViewModels/GameSelectorViewModel.cs @@ -67,7 +67,7 @@ public class GameSelectorViewModel : ViewModel public void AddUndetectedDir(string gameDirectory) => AddUndetectedDir(gameDirectory.SubstringAfterLast('\\'), gameDirectory); public void AddUndetectedDir(string gameName, string gameDirectory) { - var setting = new DirectorySettings { GameName = gameName, GameDirectory = gameDirectory, IsManual = true }; + var setting = DirectorySettings.Default(gameName, gameDirectory, true); UserSettings.Default.PerDirectory[gameDirectory] = setting; _detectedDirectories.Add(setting); SelectedDirectory = DetectedDirectories.Last(); @@ -84,7 +84,7 @@ public class GameSelectorViewModel : ViewModel private IEnumerable EnumerateDetectedGames() { yield return GetUnrealEngineGame("Fortnite", "\\FortniteGame\\Content\\Paks", EGame.GAME_UE5_2); - yield return new DirectorySettings { GameName = "Fortnite [LIVE]", GameDirectory = Constants._FN_LIVE_TRIGGER, UeVersion = EGame.GAME_UE5_2 }; + yield return DirectorySettings.Default("Fortnite [LIVE]", Constants._FN_LIVE_TRIGGER, ue: EGame.GAME_UE5_2); yield return GetUnrealEngineGame("Pewee", "\\RogueCompany\\Content\\Paks", EGame.GAME_RogueCompany); yield return GetUnrealEngineGame("Rosemallow", "\\Indiana\\Content\\Paks", EGame.GAME_UE4_21); yield return GetUnrealEngineGame("Catnip", "\\OakGame\\Content\\Paks", EGame.GAME_Borderlands3); @@ -94,7 +94,7 @@ public class GameSelectorViewModel : ViewModel yield return GetUnrealEngineGame("711c5e95dc094ca58e5f16bd48e751d6", "\\MultiVersus\\Content\\Paks", EGame.GAME_UE4_26); yield return GetUnrealEngineGame("9361c8c6d2f34b42b5f2f61093eedf48", "\\TslGame\\Content\\Paks", EGame.GAME_PlayerUnknownsBattlegrounds); yield return GetRiotGame("VALORANT", "ShooterGame\\Content\\Paks", EGame.GAME_Valorant); - yield return new DirectorySettings { GameName = "Valorant [LIVE]", GameDirectory = Constants._VAL_LIVE_TRIGGER, UeVersion = EGame.GAME_Valorant }; + yield return DirectorySettings.Default("Valorant [LIVE]", Constants._VAL_LIVE_TRIGGER, ue: EGame.GAME_Valorant); yield return GetSteamGame(381210, "\\DeadByDaylight\\Content\\Paks", EGame.GAME_UE4_27); // Dead By Daylight yield return GetSteamGame(578080, "\\TslGame\\Content\\Paks", EGame.GAME_PlayerUnknownsBattlegrounds); // PUBG yield return GetSteamGame(1172380, "\\SwGame\\Content\\Paks", EGame.GAME_StarWarsJediFallenOrder); // STAR WARS Jedi: Fallen Order™ @@ -119,7 +119,7 @@ public class GameSelectorViewModel : ViewModel if (installationList.AppName.Equals(gameName, StringComparison.OrdinalIgnoreCase) && Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in LauncherInstalled.dat", gameName); - return new DirectorySettings { GameName = installationList.AppName, GameDirectory = gameDir, UeVersion = ueVersion }; + return DirectorySettings.Default(installationList.AppName, gameDir, ue: ueVersion); } } } @@ -139,7 +139,7 @@ public class GameSelectorViewModel : ViewModel if (key.Contains(gameName, StringComparison.OrdinalIgnoreCase) && Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in RiotClientInstalls.json", gameName); - return new DirectorySettings { GameName = gameName, GameDirectory = gameDir, UeVersion = ueVersion }; + return DirectorySettings.Default(gameName, gameDir, ue: ueVersion); } } } @@ -147,30 +147,13 @@ public class GameSelectorViewModel : ViewModel return null; } - private LauncherSettings _launcherSettings; - private DirectorySettings GetMojangGame(string gameName, string pakDirectory, EGame ueVersion) - { - _launcherSettings ??= GetDataLauncherInstalls("\\.minecraft\\launcher_settings.json"); - if (_launcherSettings is { ProductLibraryDir: { } }) - { - var gameDir = $"{_launcherSettings.ProductLibraryDir}{pakDirectory}"; - if (Directory.Exists(gameDir)) - { - Log.Debug("Found {GameName} in launcher_settings.json", gameName); - return new DirectorySettings { GameName = gameName, GameDirectory = gameDir, UeVersion = ueVersion }; - } - } - - return null; - } - private DirectorySettings GetSteamGame(int id, string pakDirectory, EGame ueVersion) { var steamInfo = SteamDetection.GetSteamGameById(id); if (steamInfo is not null) { Log.Debug("Found {GameName} in steam manifests", steamInfo.Name); - return new DirectorySettings { GameName = steamInfo.Name, GameDirectory = $"{steamInfo.GameRoot}{pakDirectory}", UeVersion = ueVersion }; + return DirectorySettings.Default(steamInfo.Name, $"{steamInfo.GameRoot}{pakDirectory}", ue: ueVersion); } return null; @@ -192,7 +175,7 @@ public class GameSelectorViewModel : ViewModel if (Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in the registry", key); - return new DirectorySettings { GameName = key, GameDirectory = gameDir, UeVersion = ueVersion }; + return DirectorySettings.Default(key, gameDir, ue: ueVersion); } return null; @@ -217,7 +200,7 @@ public class GameSelectorViewModel : ViewModel if (Directory.Exists(gameDir)) { Log.Debug("Found {GameName} in the registry", key); - return new DirectorySettings { GameName = displayName, GameDirectory = gameDir, UeVersion = ueVersion }; + return DirectorySettings.Default(displayName, gameDir, ue: ueVersion); } return null; @@ -237,19 +220,6 @@ public class GameSelectorViewModel : ViewModel return default; } - private T GetDataLauncherInstalls(string jsonFile) - { - var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - var launcher = $"{appData}{jsonFile}"; - if (File.Exists(launcher)) - { - Log.Debug("\"{Launcher}\" found in \"{AppData}\"", launcher, appData); - return JsonConvert.DeserializeObject(File.ReadAllText(launcher)); - } - - return default; - } - #pragma warning disable 649 private class LauncherInstalled { diff --git a/FModel/ViewModels/SettingsViewModel.cs b/FModel/ViewModels/SettingsViewModel.cs index 4b130fb3..9b2b820a 100644 --- a/FModel/ViewModels/SettingsViewModel.cs +++ b/FModel/ViewModels/SettingsViewModel.cs @@ -72,15 +72,15 @@ public class SettingsViewModel : ViewModel set => SetProperty(ref _selectedMapStructTypes, value); } - private FEndpoint _aesEndpoint; - public FEndpoint AesEndpoint + private EndpointSettings _aesEndpoint; + public EndpointSettings AesEndpoint { get => _aesEndpoint; set => SetProperty(ref _aesEndpoint, value); } - private FEndpoint _mappingEndpoint; - public FEndpoint MappingEndpoint + private EndpointSettings _mappingEndpoint; + public EndpointSettings MappingEndpoint { get => _mappingEndpoint; set => SetProperty(ref _mappingEndpoint, value); diff --git a/FModel/Views/CustomDir.xaml.cs b/FModel/Views/CustomDir.xaml.cs index b5e87f18..4bba4d08 100644 --- a/FModel/Views/CustomDir.xaml.cs +++ b/FModel/Views/CustomDir.xaml.cs @@ -1,5 +1,5 @@ using System.Windows; -using FModel.ViewModels; +using FModel.Settings; namespace FModel.Views; @@ -9,7 +9,7 @@ public partial class CustomDir { DataContext = customDir; InitializeComponent(); - + Activate(); WpfSuckMyDick.Focus(); WpfSuckMyDick.SelectAll(); @@ -20,4 +20,4 @@ public partial class CustomDir DialogResult = true; Close(); } -} \ No newline at end of file +} diff --git a/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs b/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs index 7d73f1be..3070242b 100644 --- a/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs +++ b/FModel/Views/Resources/Controls/EndpointEditor.xaml.cs @@ -2,12 +2,10 @@ using System.Windows; using System.Windows.Controls; using FModel.Extensions; -using FModel.Framework; using FModel.Services; +using FModel.Settings; using ICSharpCode.AvalonEdit.Document; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using RestSharp; namespace FModel.Views.Resources.Controls; @@ -16,7 +14,7 @@ public partial class EndpointEditor private readonly EEndpointType _type; private bool _isTested; - public EndpointEditor(FEndpoint endpoint, string title, EEndpointType type) + public EndpointEditor(EndpointSettings endpoint, string title, EEndpointType type) { DataContext = endpoint; _type = type; @@ -52,13 +50,13 @@ public partial class EndpointEditor private void OnClick(object sender, RoutedEventArgs e) { - DialogResult = _isTested && DataContext is FEndpoint { IsValid: true }; + DialogResult = _isTested && DataContext is EndpointSettings { IsValid: true }; Close(); } private async void OnSend(object sender, RoutedEventArgs e) { - if (DataContext is not FEndpoint endpoint) return; + if (DataContext is not EndpointSettings endpoint) return; var body = await ApplicationService.ApiEndpointView.DynamicApi.GetRequestBody(default, endpoint.Url).ConfigureAwait(false); Application.Current.Dispatcher.Invoke(delegate @@ -70,7 +68,7 @@ public partial class EndpointEditor private void OnTest(object sender, RoutedEventArgs e) { - if (DataContext is not FEndpoint endpoint) return; + if (DataContext is not EndpointSettings endpoint) return; endpoint.TryValidate(ApplicationService.ApiEndpointView.DynamicApi, _type, out var response); _isTested = true; @@ -82,7 +80,7 @@ public partial class EndpointEditor private void OnTextChanged(object sender, TextChangedEventArgs e) { if (sender is not TextBox { IsLoaded: true } || - DataContext is not FEndpoint endpoint) return; + DataContext is not EndpointSettings endpoint) return; endpoint.IsValid = false; }