Something went wrong. Try again.
Modular scanner/radio client and multi-broadcast server. uniscan.dexrn.me
Something went wrong. Try again.
UniScan src Modules UniScan.Modules.WebSocketTransportMethod View WebSocketConnectionMethodFactoryViewModel.cs
12345678910111213141516171819202122232425262728293031#if UNISCAN_CLIENT && UNISCAN_APPusing System.ComponentModel.DataAnnotations;using CommunityToolkit.Mvvm.ComponentModel;using UniScan.Client.App.UI.ConnectionMethod;using UniScan.Client.App.UI.Validation;using UniScan.Client.App.Views.ViewModel;using UniScan.Modules.WebSocketTransportMethod.Network;using UniScan.Modules.WebSocketTransportMethod.Parser;
namespace UniScan.Modules.WebSocketTransportMethod.View;
[ConnectionMethodFactoryViewModel("WebSocket")]public partial class WebSocketConnectionMethodFactoryViewModel : ViewModelBase, IConnectionMethodFactoryViewModel<WebSocketConnectionMethodFactoryViewModel, WebSocketRemoteConnectionMethod>{ public WebSocketConnectionMethodFactoryViewModel() { ValidateAllProperties(); } [ObservableProperty] [NotifyDataErrorInfo] [Required(ErrorMessage = "URL is required")] [NotifyPropertyChangedFor(nameof(IsValid))] [ValidatorParser<UriValidatorParser>(ErrorMessage = "Must be a valid URL")] public partial string Url { get; set; }
public bool IsValid => !GetErrors(nameof(Url)).Any(); public WebSocketRemoteConnectionMethod Create() => new(new Uri(Url));}#endif