diff --git a/LaDOSE.Src/LaDOSE.Api/Controllers/UsersController.cs b/LaDOSE.Src/LaDOSE.Api/Controllers/UsersController.cs index 67e4db0..78b0dae 100644 --- a/LaDOSE.Src/LaDOSE.Api/Controllers/UsersController.cs +++ b/LaDOSE.Src/LaDOSE.Api/Controllers/UsersController.cs @@ -71,7 +71,7 @@ namespace LaDOSE.Api.Controllers }); } - //[AllowAnonymous] + [AllowAnonymous] [HttpPost("register")] public IActionResult Register([FromBody]ApplicationUser userDto) { diff --git a/LaDOSE.Src/LaDOSE.Api/Startup.cs b/LaDOSE.Src/LaDOSE.Api/Startup.cs index 0b700ce..41581e8 100644 --- a/LaDOSE.Src/LaDOSE.Api/Startup.cs +++ b/LaDOSE.Src/LaDOSE.Api/Startup.cs @@ -40,11 +40,6 @@ namespace LaDOSE.Api public void ConfigureServices(IServiceCollection services) { //Fix Gentoo Issue. - - var MySqlServer = this.Configuration["MySql:Server"]; - var MySqlDatabase = this.Configuration["MySql:Database"]; - var MySqlUser = this.Configuration["MySql:User"]; - var MySqlPassword = this.Configuration["MySql:Password"]; if (Convert.ToBoolean(this.Configuration["FixGentoo"])) { try diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml new file mode 100644 index 0000000..864390f --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml.cs new file mode 100644 index 0000000..a01c976 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/App.axaml.cs @@ -0,0 +1,33 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; +using LaDOSE.DesktopApp.Avalonia.ViewModels; +using LaDOSE.DesktopApp.Avalonia.Views; +using ReactiveUI; +using Splat; + +namespace LaDOSE.DesktopApp.Avalonia; + +public partial class App : Application +{ + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + Locator.CurrentMutable.Register(() => new GamesView(), typeof(IViewFor)); + Locator.CurrentMutable.Register(() => new InfoView(), typeof(IViewFor)); + Locator.CurrentMutable.Register(() => new TournamentResultView(), typeof(IViewFor)); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + desktop.MainWindow = new MainWindow + { + DataContext = new MainWindowViewModel(), + }; + } + + base.OnFrameworkInitializationCompleted(); + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Assets/avalonia-logo.ico b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Assets/avalonia-logo.ico new file mode 100644 index 0000000..da8d49f Binary files /dev/null and b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Assets/avalonia-logo.ico differ diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj new file mode 100644 index 0000000..84a806d --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/LaDOSE.DesktopApp.Avalonia.csproj @@ -0,0 +1,33 @@ + + + WinExe + net6.0 + enable + true + app.manifest + true + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs new file mode 100644 index 0000000..1348484 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Program.cs @@ -0,0 +1,53 @@ +using Avalonia; +using Avalonia.ReactiveUI; +using System; +using System.ComponentModel; +using LaDOSE.REST; +using Splat; +// using Xilium.CefGlue; +// using Xilium.CefGlue.Common; +// using Avalonia.Visuals; +namespace LaDOSE.DesktopApp.Avalonia; + +sealed class Program +{ + + + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) + { + RegisterDependencies(Locator.CurrentMutable, Locator.Current); + BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + } + + private static void RegisterDependencies(IMutableDependencyResolver currentMutable, IReadonlyDependencyResolver current) + { + currentMutable.RegisterLazySingleton(()=> + { + var restService = new RestService(); + restService.Connect(new Uri("http://localhost:5000"),"dev","dev"); + return restService; + }); + } + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder + .Configure() + .UsePlatformDetect() + .WithInterFont() + .LogToTrace() + .AfterSetup(_ => + { + // CefRuntimeLoader.Initialize(new CefSettings() + // { + // WindowlessRenderingEnabled = true, + // NoSandbox = true, + // }); + }) + .UseReactiveUI(); +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Resources/64x64.png b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Resources/64x64.png new file mode 100644 index 0000000..e4e114c Binary files /dev/null and b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Resources/64x64.png differ diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Resources/css.css b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Resources/css.css new file mode 100644 index 0000000..8504a92 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Resources/css.css @@ -0,0 +1,343 @@ +body { + color: #efefef; + background-color: #141415; +} + + + +:root { + --breakpoint-xs: 0; + --breakpoint-sm: 576px; + --breakpoint-md: 768px; + --breakpoint-lg: 992px; + --breakpoint-xl: 1200px; +} + +.table { + width: 100%; + margin-bottom: 1rem; + background-color: transparent; +} + + .table th, + .table td { + padding: 0.75rem; + vertical-align: top; + border-top: 1px solid #dee2e6; + } + + .table thead th { + vertical-align: bottom; + border-bottom: 2px solid #dee2e6; + } + + .table tbody + tbody { + border-top: 2px solid #dee2e6; + } + + .table .table { + background-color: #fff; + } + +.table-sm th, +.table-sm td { + padding: 0.3rem; +} + +.table-bordered { + border: 1px solid #dee2e6; +} + + .table-bordered th, + .table-bordered td { + border: 1px solid #dee2e6; + } + + .table-bordered thead th, + .table-bordered thead td { + border-bottom-width: 2px; + } + +.table-borderless th, +.table-borderless td, +.table-borderless thead th, +.table-borderless tbody + tbody { + border: 0; +} + +.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(0, 0, 0, 0.05); +} + +.table-hover tbody tr:hover { + background-color: rgba(0, 0, 0, 0.075); +} + +.table-primary, +.table-primary > th, +.table-primary > td { + background-color: #b8daff; +} + +.table-hover .table-primary:hover { + background-color: #9fcdff; +} + + .table-hover .table-primary:hover > td, + .table-hover .table-primary:hover > th { + background-color: #9fcdff; + } + +.table-secondary, +.table-secondary > th, +.table-secondary > td { + background-color: #d6d8db; +} + +.table-hover .table-secondary:hover { + background-color: #c8cbcf; +} + + .table-hover .table-secondary:hover > td, + .table-hover .table-secondary:hover > th { + background-color: #c8cbcf; + } + +.table-success, +.table-success > th, +.table-success > td { + background-color: #c3e6cb; +} + +.table-hover .table-success:hover { + background-color: #b1dfbb; +} + + .table-hover .table-success:hover > td, + .table-hover .table-success:hover > th { + background-color: #b1dfbb; + } + +.table-info, +.table-info > th, +.table-info > td { + background-color: #bee5eb; +} + +.table-hover .table-info:hover { + background-color: #abdde5; +} + + .table-hover .table-info:hover > td, + .table-hover .table-info:hover > th { + background-color: #abdde5; + } + +.table-warning, +.table-warning > th, +.table-warning > td { + background-color: #ffeeba; +} + +.table-hover .table-warning:hover { + background-color: #ffe8a1; +} + + .table-hover .table-warning:hover > td, + .table-hover .table-warning:hover > th { + background-color: #ffe8a1; + } + +.table-danger, +.table-danger > th, +.table-danger > td { + background-color: #f5c6cb; +} + +.table-hover .table-danger:hover { + background-color: #f1b0b7; +} + + .table-hover .table-danger:hover > td, + .table-hover .table-danger:hover > th { + background-color: #f1b0b7; + } + +.table-light, +.table-light > th, +.table-light > td { + background-color: #fdfdfe; +} + +.table-hover .table-light:hover { + background-color: #ececf6; +} + + .table-hover .table-light:hover > td, + .table-hover .table-light:hover > th { + background-color: #ececf6; + } + +.table-dark, +.table-dark > th, +.table-dark > td { + background-color: #c6c8ca; +} + +.table-hover .table-dark:hover { + background-color: #b9bbbe; +} + + .table-hover .table-dark:hover > td, + .table-hover .table-dark:hover > th { + background-color: #b9bbbe; + } + +.table-active, +.table-active > th, +.table-active > td { + background-color: rgba(0, 0, 0, 0.075); +} + +.table-hover .table-active:hover { + background-color: rgba(0, 0, 0, 0.075); +} + + .table-hover .table-active:hover > td, + .table-hover .table-active:hover > th { + background-color: rgba(0, 0, 0, 0.075); + } + +.table .thead-dark th { + color: #fff; + background-color: #212529; + border-color: #32383e; +} + +.table .thead-light th { + color: #495057; + background-color: #e9ecef; + border-color: #dee2e6; +} + +.table-dark { + color: #fff; + background-color: #212529; +} + + .table-dark th, + .table-dark td, + .table-dark thead th { + border-color: #32383e; + } + + .table-dark.table-bordered { + border: 0; + } + + .table-dark.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(255, 255, 255, 0.05); + } + + .table-dark.table-hover tbody tr:hover { + background-color: rgba(255, 255, 255, 0.075); + } + +@media (max-width: 575.98px) { + .table-responsive-sm { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + + .table-responsive-sm > .table-bordered { + border: 0; + } +} + +@media (max-width: 767.98px) { + .table-responsive-md { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + + .table-responsive-md > .table-bordered { + border: 0; + } +} + +@media (max-width: 991.98px) { + .table-responsive-lg { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + + .table-responsive-lg > .table-bordered { + border: 0; + } +} + +@media (max-width: 1199.98px) { + .table-responsive-xl { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + + .table-responsive-xl > .table-bordered { + border: 0; + } +} + +.table-responsive { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + -ms-overflow-style: -ms-autohiding-scrollbar; +} + + .table-responsive > .table-bordered { + border: 0; + } + +.table { + border-collapse: collapse !important; +} + + .table td, + .table th { + /*background-color: #fff !important;*/ + } + +.table-bordered th, +.table-bordered td { + border: 1px solid #dee2e6 !important; +} + +.table-dark { + color: #fff; + background-color: #212529 +} + + .table-dark th, + .table-dark td, + .table-dark thead th, + .table-dark tbody + tbody { + border-color: #dee2e6; + } + +.table .thead-dark th { + color: inherit; + border-color: #dee2e6; +} diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/BaseViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/BaseViewModel.cs new file mode 100644 index 0000000..59c81a9 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/BaseViewModel.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; +using ReactiveUI; + +namespace LaDOSE.DesktopApp.Avalonia.Utils; + +public abstract class BaseViewModel : ReactiveObject, IRoutableViewModel,INotifyPropertyChanged +{ + + public event PropertyChangedEventHandler? PropertyChanged; + protected void RaisePropertyChanged([CallerMemberName] string? propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + protected BaseViewModel(IScreen hostScreen, string? urlPathSegment) + { + UrlPathSegment = urlPathSegment; + HostScreen = hostScreen; + } + + public string? UrlPathSegment { get; } + public IScreen HostScreen { get; } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/Utils/CustomEqualityCompare.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/CustomEqualityCompare.cs similarity index 93% rename from LaDOSE.Src/LaDOSE.DesktopApp/Utils/CustomEqualityCompare.cs rename to LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/CustomEqualityCompare.cs index 4cd1caa..de22e5d 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp/Utils/CustomEqualityCompare.cs +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Utils/CustomEqualityCompare.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace LaDOSE.DesktopApp.Utils +namespace LaDOSE.DesktopApp.Avalonia.Utils { public static class CustomListExtension { diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/GamesViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/GamesViewModel.cs new file mode 100644 index 0000000..687a305 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/GamesViewModel.cs @@ -0,0 +1,86 @@ +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using LaDOSE.DesktopApp.Avalonia.Utils; +using LaDOSE.DesktopApp.Avalonia.ViewModels; +using LaDOSE.DTO; +using LaDOSE.REST; +using ReactiveUI; +using Splat; + +namespace LaDOSE.DesktopApp.Avalonia.ViewModels +{ + public class GamesViewModel : BaseViewModel + { + + public string DisplayName => "Games"; + + private GameDTO _currentGame; + private List _games; + private RestService RestService { get; set; } + public GamesViewModel(IScreen screen): base(screen,"Games") + { + this.RestService = Locator.Current.GetService(); + this.Games=new List(); + OnInitialize(); + } + + void OnInitialize() + { + LoadGames(); + this.CurrentGame = Games.First(); + } + + public void LoadGames() + { + var gameDtos = this.RestService.GetGames().OrderBy(e=>e.Order).ToList(); + this.Games = gameDtos; + RaisePropertyChanged(nameof(this.Games)); + } + + public List Games + { + get => _games; + set + { + _games = value; + RaisePropertyChanged(nameof(this.Games)); + } + } + + public GameDTO CurrentGame + { + get => _currentGame; + set + { + _currentGame = value; + RaisePropertyChanged(nameof(this.CurrentGame)); + + } + } + + public void Update() + { + this.RestService.UpdateGame(this.CurrentGame); + LoadGames(); + + } + public void AddGame() + { + var item = new GameDTO(); + this.RestService.UpdateGame(item); + LoadGames(); + } + public void DeleteGame() + { + + this.RestService.DeleteGame(this.CurrentGame.Id); + LoadGames(); + } + + public bool CanDeleteGame => CurrentGame != null; + + + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/InfoViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/InfoViewModel.cs new file mode 100644 index 0000000..28749af --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/InfoViewModel.cs @@ -0,0 +1,16 @@ +using System.ComponentModel; +using ReactiveUI; + +namespace LaDOSE.DesktopApp.Avalonia.ViewModels; + +public class InfoViewModel: ReactiveObject, IRoutableViewModel,INotifyPropertyChanged +{ + + public InfoViewModel(IScreen screen) + { + HostScreen = screen; + } + + public string? UrlPathSegment => "Info"; + public IScreen HostScreen { get; } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/MainWindowViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/MainWindowViewModel.cs new file mode 100644 index 0000000..699e202 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,16 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.ApplicationLifetimes; + +namespace LaDOSE.DesktopApp.Avalonia.ViewModels; + +public class MainWindowViewModel : Window +{ + public RoutedViewHostViewModel RoutedViewViewHost { get; } = new(); + + public void CloseApp() + { + if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime) + ((IClassicDesktopStyleApplicationLifetime)Application.Current.ApplicationLifetime).Shutdown(); + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/RoutedViewHostViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/RoutedViewHostViewModel.cs new file mode 100644 index 0000000..f68ddf9 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/RoutedViewHostViewModel.cs @@ -0,0 +1,61 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; +using LaDOSE.DesktopApp.Avalonia.Utils; +using ReactiveUI; + +namespace LaDOSE.DesktopApp.Avalonia.ViewModels; + +public class RoutedViewHostViewModel : ReactiveObject, IScreen, INotifyPropertyChanged +{ + public event PropertyChangedEventHandler? PropertyChanged; + protected void RaisePropertyChanged([CallerMemberName] string? propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + private string _current; + + public RoutedViewHostViewModel() + { + Games = new GamesViewModel(this); + Info = new InfoViewModel(this); + Tournament = new TournamentResultViewModel(this); + Router.Navigate.Execute(Tournament); + Current = "Tournament"; + + } + + public string Current + { + get => _current; + set + { + _current = value; + RaisePropertyChanged(nameof(Current)); + } + } + + public RoutingState Router { get; } = new(); + public GamesViewModel Games { get; } + public InfoViewModel Info { get; } + + public TournamentResultViewModel Tournament { get; } + + + public void ShowGames() + { + Router.Navigate.Execute(Games); + Current = "Games"; + } + + public void ShowInfo() + { + Router.Navigate.Execute(Info); + Current = "Info"; + } + public void ShowTournament() + { + Router.Navigate.Execute(Tournament); + Current = "Tournament"; + } +} diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/TournamentResultViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/TournamentResultViewModel.cs similarity index 76% rename from LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/TournamentResultViewModel.cs rename to LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/TournamentResultViewModel.cs index 1ffc014..20f17c4 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/TournamentResultViewModel.cs +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/ViewModels/TournamentResultViewModel.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; @@ -8,19 +7,19 @@ using System.Linq; using System.Reflection; using System.Text; using System.Text.RegularExpressions; -using System.Windows.Controls; -using System.Windows.Forms; -using LaDOSE.DesktopApp.Utils; +using Avalonia.Collections; +using Avalonia.Controls; +using LaDOSE.DesktopApp.Avalonia.Utils; using LaDOSE.DTO; using LaDOSE.REST; -using SaveFileDialog = Microsoft.Win32.SaveFileDialog; -using Screen = Caliburn.Micro.Screen; +using ReactiveUI; +using Splat; -namespace LaDOSE.DesktopApp.ViewModels +namespace LaDOSE.DesktopApp.Avalonia.ViewModels { - public class TournamentResultViewModel : Screen + public class TournamentResultViewModel : BaseViewModel { - public override string DisplayName => "Tournament Result"; + public string DisplayName => "Tournament Result"; private RestService RestService { get; set; } //Dictionary> _computedResult; @@ -28,13 +27,7 @@ namespace LaDOSE.DesktopApp.ViewModels #region Properties private string css = string.Empty; - - //"strong { font-weight: 700;} ". + - // "a { color: #ff9024;}"+ - // "body { color: #efefef;background-color: #141415; }" + - // ""+ - // "a:hover, .entry-meta span a:hover, .comments-link a:hover, body.coldisplay2 #front-columns a:active {color: #cb5920;}"+ - // "tr td { border: 1px dashed #3D3D3D;} "; + private String _selectRegex; public String SelectRegex @@ -43,7 +36,7 @@ namespace LaDOSE.DesktopApp.ViewModels set { _selectRegex = value; - NotifyOfPropertyChange(() => SelectRegex); + RaisePropertyChanged(nameof(SelectRegex)); } } @@ -55,7 +48,7 @@ namespace LaDOSE.DesktopApp.ViewModels set { _selectEventRegex = value; - NotifyOfPropertyChange(() => SelectEventRegex); + RaisePropertyChanged(nameof(SelectEventRegex)); } } private string _slug; @@ -65,7 +58,7 @@ namespace LaDOSE.DesktopApp.ViewModels set { _slug = value; - NotifyOfPropertyChange(() => Slug); + RaisePropertyChanged(nameof(Slug)); } } @@ -87,34 +80,34 @@ namespace LaDOSE.DesktopApp.ViewModels set { _htmlContent = value; - NotifyOfPropertyChange(() => HtmlContent); - NotifyOfPropertyChange(() => Html); + RaisePropertyChanged(nameof(HtmlContent)); + RaisePropertyChanged(nameof(Html)); } } - private DateTime _from; + private DateTimeOffset _from; - public DateTime From + public DateTimeOffset From { get { return _from; } set { _from = value; - NotifyOfPropertyChange(() => From); + RaisePropertyChanged(nameof(From)); } } - private DateTime _to; + private DateTimeOffset _to; - public DateTime To + public DateTimeOffset To { get { return _to; } set { _to = value; - NotifyOfPropertyChange(() => To); + RaisePropertyChanged(nameof(To)); } } @@ -130,7 +123,7 @@ namespace LaDOSE.DesktopApp.ViewModels set { _results = value; - NotifyOfPropertyChange(() => Results); + RaisePropertyChanged(nameof(Results)); } } @@ -142,7 +135,7 @@ namespace LaDOSE.DesktopApp.ViewModels set { _selectedEvents = value; - NotifyOfPropertyChange(() => SelectedEvents); + RaisePropertyChanged(nameof(SelectedEvents)); } } @@ -154,7 +147,7 @@ namespace LaDOSE.DesktopApp.ViewModels set { _selectedTournaments = value; - NotifyOfPropertyChange(() => SelectedTournaments); + RaisePropertyChanged(nameof(SelectedTournaments)); } } @@ -175,7 +168,7 @@ namespace LaDOSE.DesktopApp.ViewModels SelectedGameResult = new ObservableCollection(resultForGame); } - NotifyOfPropertyChange(() => SelectedGame); + RaisePropertyChanged(nameof(SelectedGame)); } } @@ -187,12 +180,13 @@ namespace LaDOSE.DesktopApp.ViewModels set { _selectedGameResult = value; - NotifyOfPropertyChange(() => SelectedGameResult); + RaisePropertyChanged(nameof(SelectedGameResult)); } } private String _first; private DataTable _gridDataTable; + private string _error; public String First { @@ -200,65 +194,62 @@ namespace LaDOSE.DesktopApp.ViewModels set { _first = value; - NotifyOfPropertyChange(() => First); + RaisePropertyChanged(nameof(First)); } } #endregion - public TournamentResultViewModel(RestService restService) + public TournamentResultViewModel(IScreen hostScreen):base(hostScreen,"Tournament") { - this.RestService = restService; + this.RestService = Locator.Current.GetService();; _selectedTournaments = new ObservableCollection(); _selectedEvents = new ObservableCollection(); Tournaments = new List(); Events = new List(); - + OnInitialize(); } - protected override void OnInitialize() + protected void OnInitialize() { - var manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("LaDOSE.DesktopApp.Resources.css.css"); - using (var sr = new StreamReader(manifestResourceStream)) - { - this.css = sr.ReadToEnd(); - } + // var manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("LaDOSE.DesktopApp.Resources.css.css"); + // using (var sr = new StreamReader(manifestResourceStream)) + // { + // this.css = sr.ReadToEnd(); + // } - this.To = DateTime.Now; - this.From = DateTime.Now.AddMonths(-1); + this.To = new DateTimeOffset(DateTime.Now); + this.From = new DateTimeOffset(DateTime.Now.AddMonths(-1)); this.SelectRegex = "Ranking"; this.SelectEventRegex = @"Ranking #10\d{2}"; this.Slug = "ranking-1001"; LoadTournaments(); LoadEvents(); - base.OnInitialize(); } public void LoadTournaments() { - WpfUtil.Await(() => - { - var tournamentDtos = this.RestService - .GetTournaments(new TimeRangeDTO() {From = this.From, To = this.To}).ToList(); - this.Tournaments = tournamentDtos; + + // var tournamentDtos = this.RestService + // .GetTournaments(new TimeRangeDTO() {From = this.From, To = this.To}).ToList(); + // this.Tournaments = tournamentDtos; - NotifyOfPropertyChange("Tournaments"); - }); + RaisePropertyChanged(nameof(Tournaments)); + } public void LoadEvents() { - WpfUtil.Await(() => - { + var eventsDtos = this.RestService .GetAllEvents().ToList(); this.Events = eventsDtos; - NotifyOfPropertyChange("Events"); - }); + RaisePropertyChanged(nameof(Events)); + } public DataTable GridDataTable @@ -267,44 +258,61 @@ namespace LaDOSE.DesktopApp.ViewModels set { _gridDataTable = value; - NotifyOfPropertyChange(() => GridDataTable); + RaisePropertyChanged(nameof(GridDataTable)); + RaisePropertyChanged(nameof(GridDataTableView)); + } + } + public DataView GridDataTableView + { + get + { + DataView gridDataTableView = _gridDataTable?.AsDataView(); + return gridDataTableView; } } public void Select() { - WpfUtil.Await(() => - { + var tournamentsIds = SelectedEvents.Select(e => e.Id).ToList(); var resultsDto = this.RestService.GetResults(tournamentsIds); this.Results = resultsDto; ComputeDataGrid(); ComputeHtml(); - }); + } public void GetSmash() { - WpfUtil.Await(() => - { + var resultsDto = this.RestService.ParseSmash(Slug); if (!resultsDto) { - MessageBox.Show("Fail"); + Error = "Error getting Smash"; } - }); + } + + public string Error + { + get => _error; + set + { + if (value == _error) return; + _error = value; + RaisePropertyChanged(); + } + } + public void GetChallonge() { - WpfUtil.Await(() => - { + var ids = SelectedTournaments.Select(e => e.ChallongeId).ToList(); var resultsDto = this.RestService.ParseChallonge(ids); if (!resultsDto) { - MessageBox.Show("Fail"); + Error = "Fail"; } - }); } public void UpdateEvent() @@ -329,14 +337,14 @@ namespace LaDOSE.DesktopApp.ViewModels var selectedTournaments = this.Tournaments.Where(e => Regex.IsMatch(e.Name, this.SelectRegex)).ToList(); this.SelectedTournaments.Clear(); if (selectedTournaments.Count > 0) - selectedTournaments.ForEach(e => this.SelectedTournaments.AddUI(e)); + selectedTournaments.ForEach(e => this.SelectedTournaments.Add(e)); } public void SelectEvent() { var selectedEvents = this.Events.Where(e => Regex.IsMatch(e.Name, this.SelectEventRegex)).ToList(); this.SelectedEvents.Clear(); if (selectedEvents.Count > 0) - selectedEvents.ForEach(e => this.SelectedEvents.AddUI(e)); + selectedEvents.ForEach(e => this.SelectedEvents.Add(e)); } //This could be simplified the Dictionary was for a previous usage, but i m too lazy to rewrite it. private void ComputeDataGrid() @@ -367,7 +375,7 @@ namespace LaDOSE.DesktopApp.ViewModels { var resultsGame = Results.Games[j]; var points = GetPlayerPoint(resultsParticipent, resultsGame.Id); - dataRow[resultsGame.Name.Replace('.', ' ')] = points!=0?(object) points:DBNull.Value; + dataRow[resultsGame.Name.Replace('.', ' ')] = points!=0?points:0; total += points; } dataRow["Total"] = total; @@ -389,33 +397,33 @@ namespace LaDOSE.DesktopApp.ViewModels private void ExportToCSV() { - if (this.GridDataTable != null) - { - var dataTable = this.GridDataTable.DefaultView.ToTable(); - SaveFileDialog sfDialog = new SaveFileDialog() - { - Filter = "Csv Files (*.csv)|*.csv|All Files (*.*)|*.*", - AddExtension = true - }; - if (sfDialog.ShowDialog() == true) - { - StringBuilder sb = new StringBuilder(); - - IEnumerable columnNames = dataTable.Columns.Cast() - .Select(column => column.ColumnName); - sb.AppendLine(string.Join(";", columnNames)); - - foreach (DataRow row in dataTable.Rows) - { - //EXCEL IS A BITCH - IEnumerable fields = row.ItemArray.Select(field => - string.Concat("\"", field.ToString().Replace("\"", "\"\""), "\"")); - sb.AppendLine(string.Join(";", fields)); - } - - File.WriteAllText(sfDialog.FileName, sb.ToString()); - } - } + // if (this.GridDataTable != null) + // { + // var dataTable = this.GridDataTable.DefaultView.ToTable(); + // SaveFileDialog sfDialog = new SaveFileDialog() + // { + // Filter = "Csv Files (*.csv)|*.csv|All Files (*.*)|*.*", + // AddExtension = true + // }; + // if (sfDialog.ShowDialog() == true) + // { + // StringBuilder sb = new StringBuilder(); + // + // IEnumerable columnNames = dataTable.Columns.Cast() + // .Select(column => column.ColumnName); + // sb.AppendLine(string.Join(";", columnNames)); + // + // foreach (DataRow row in dataTable.Rows) + // { + // //EXCEL IS A BITCH + // IEnumerable fields = row.ItemArray.Select(field => + // string.Concat("\"", field.ToString().Replace("\"", "\"\""), "\"")); + // sb.AppendLine(string.Join(";", fields)); + // } + // + // File.WriteAllText(sfDialog.FileName, sb.ToString()); + // } + // } } private void ComputeHtml() @@ -483,7 +491,7 @@ namespace LaDOSE.DesktopApp.ViewModels } public void CopyHtml() { - System.Windows.Clipboard.SetText(this.HtmlContent); + // System.Windows.Clipboard.SetText(this.HtmlContent); } private int GetPlayerPoint(string name, int gameid) diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml new file mode 100644 index 0000000..a5a6230 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml.cs new file mode 100644 index 0000000..747d0bf --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/GamesView.axaml.cs @@ -0,0 +1,23 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using LaDOSE.DesktopApp.Avalonia.ViewModels; +using ReactiveUI; + +namespace LaDOSE.DesktopApp.Avalonia.Views; + +public partial class GamesView : UserControl,IViewFor +{ + public GamesView() + { + InitializeComponent(); + } + + object? IViewFor.ViewModel + { + get => ViewModel; + set => ViewModel = (GamesViewModel?)value; + } + + public GamesViewModel? ViewModel { get; set; } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/InfoView.axaml b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/InfoView.axaml new file mode 100644 index 0000000..92e4408 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/InfoView.axaml @@ -0,0 +1,8 @@ + + + diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/InfoView.axaml.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/InfoView.axaml.cs new file mode 100644 index 0000000..700cefa --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/InfoView.axaml.cs @@ -0,0 +1,24 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using LaDOSE.DesktopApp.Avalonia.ViewModels; +using ReactiveUI; + +namespace LaDOSE.DesktopApp.Avalonia.Views; + +public partial class InfoView : UserControl, IViewFor +{ + // private AvaloniaCefBrowser browser; + public InfoView() + { + InitializeComponent(); + } + + object? IViewFor.ViewModel + { + get => ViewModel; + set => ViewModel = (InfoViewModel?)value; + } + + public InfoViewModel? ViewModel { get; set; } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/MainWindow.axaml b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/MainWindow.axaml new file mode 100644 index 0000000..fa41406 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/MainWindow.axaml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + User : + + + + diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/MainWindow.axaml.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/MainWindow.axaml.cs new file mode 100644 index 0000000..f093f67 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/MainWindow.axaml.cs @@ -0,0 +1,12 @@ +using Avalonia.Controls; + +namespace LaDOSE.DesktopApp.Avalonia.Views; + +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } + +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml new file mode 100644 index 0000000..552cb97 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Game : + + + + + + + + + + + + + + + + Participents : + + + + + + + + + + + + + + + + + + + + + + + Total : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml.cs b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml.cs new file mode 100644 index 0000000..6c43266 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/Views/TournamentResultView.axaml.cs @@ -0,0 +1,56 @@ + +using System.Data; +using System.Diagnostics; +using System.Linq; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Data; +using LaDOSE.DesktopApp.Avalonia.ViewModels; +using ReactiveUI; + +namespace LaDOSE.DesktopApp.Avalonia.Views +{ + /// + /// Interaction logic for ShellView.xaml + /// + public partial class TournamentResultView : UserControl, IViewFor + { + public TournamentResultView() + { + InitializeComponent(); + } + + + object? IViewFor.ViewModel + { + get => ViewModel; + set => ViewModel = (TournamentResultViewModel)value; + } + + public TournamentResultViewModel? ViewModel { get; set; } + + private void DataGrid_OnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e) + { + if (e.Property.Name == "ItemsSource") + { + Trace.WriteLine("Changed Binding"); + + var grid = (sender as DataGrid); + grid.Columns.Clear(); + var data = ViewModel.GridDataTable; + + foreach (DataColumn? view in data.Columns) + { + + grid.Columns.Add(new DataGridTextColumn() + { + Header = view.ColumnName, + CanUserSort = true, + Binding = new Binding($"Row.ItemArray[{view.Ordinal}]") + }); + } + } + return; + } + } +} diff --git a/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/app.manifest b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/app.manifest new file mode 100644 index 0000000..21e05ae --- /dev/null +++ b/LaDOSE.Src/LaDOSE.DesktopApp.Avalonia/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/LaDOSE.DesktopApp.csproj b/LaDOSE.Src/LaDOSE.DesktopApp/LaDOSE.DesktopApp.csproj index 68b4058..d8d2ec4 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp/LaDOSE.DesktopApp.csproj +++ b/LaDOSE.Src/LaDOSE.DesktopApp/LaDOSE.DesktopApp.csproj @@ -11,7 +11,7 @@ WinExe LaDOSE.DesktopApp LaDOSE.DesktopApp - v4.6.1 + v4.7 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -71,27 +71,6 @@ bin\x64\Release\ - - ..\packages\Caliburn.Micro.Core.3.2.0\lib\net45\Caliburn.Micro.dll - - - ..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.dll - - - ..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.Core.dll - - - ..\packages\CefSharp.Common.103.0.120\lib\net452\CefSharp.dll - - - ..\packages\CefSharp.Common.103.0.120\lib\net452\CefSharp.Core.dll - - - ..\packages\CefSharp.Wpf.103.0.120\lib\net452\CefSharp.Wpf.dll - - - ..\packages\RestSharp.106.11.4\lib\net452\RestSharp.dll - @@ -101,9 +80,6 @@ - - ..\packages\Caliburn.Micro.3.2.0\lib\net45\System.Windows.Interactivity.dll - @@ -126,8 +102,6 @@ - - @@ -163,10 +137,6 @@ App.xaml Code - - MSBuild:Compile - Designer - Designer MSBuild:Compile @@ -214,7 +184,6 @@ ResXFileCodeGenerator Resources.Designer.cs - SettingsSingleFileGenerator Settings.Designer.cs diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/Themes/LeftMarginMultiplierConverter.cs b/LaDOSE.Src/LaDOSE.DesktopApp/Themes/LeftMarginMultiplierConverter.cs deleted file mode 100644 index 95ce71a..0000000 --- a/LaDOSE.Src/LaDOSE.DesktopApp/Themes/LeftMarginMultiplierConverter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; - -namespace DarkBlendTheme -{ - public class LeftMarginMultiplierConverter : IValueConverter - { - public double Length { get; set; } - - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - var item = value as TreeViewItem; - if (item == null) - return new Thickness(0); - - return new Thickness(Length * item.GetDepth(), 0, 0, 0); - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new System.NotImplementedException(); - } - } -} diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/Themes/Styles.xaml b/LaDOSE.Src/LaDOSE.DesktopApp/Themes/Styles.xaml deleted file mode 100644 index 95d89b9..0000000 --- a/LaDOSE.Src/LaDOSE.DesktopApp/Themes/Styles.xaml +++ /dev/null @@ -1,3096 +0,0 @@ - - - - - - - #444444 - #333333 - #595959 - #3D3D3D - #424242 - #666666 - - #EFEFEF - - #BDBDBD - #525252 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - M-0.7,5.2 L-2.2,6.7 3.6,12.6 9.5,6.7 8,5.2 3.6,9.6 z - M-2.2,10.9 L-0.7,12.4 3.7,8 8,12.4 9.5,10.9 3.7,5 z - M1.0E-41,4.2 L0,2.1 2.5,4.5 6.7,4.4E-47 6.7,2.3 2.5,6.7 z - M7.2,5 L5.5,7.16 4.16,6.3 3.5,6.7 5.5,8.4 8.6,5.25 C8.6,5.25 8,4.7 7.22,5 - M 0,0 L 4,3.5 L 0,7 Z - M 1,1.5 L 4.5,5 L 8,1.5 - M 1,4.5 L 4.5,1 L 8,4.5 - M6.5,2.6C4.767,0.973 2.509,0 0,0 0,0 0,19 0,19L23,19z - M3.5445026,0 L7.0890052,7.0890053 L3.0459049E-09,7.0890053 z - M-0,6 L-0,8 8,8 8,-0 6,-0 6,6 z - M5,-0 L9,5 1,5 z - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/Themes/TreeViewItemExtensions.cs b/LaDOSE.Src/LaDOSE.DesktopApp/Themes/TreeViewItemExtensions.cs deleted file mode 100644 index e6c605c..0000000 --- a/LaDOSE.Src/LaDOSE.DesktopApp/Themes/TreeViewItemExtensions.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Media; - -namespace DarkBlendTheme -{ - public static class TreeViewItemExtensions - { - public static int GetDepth(this TreeViewItem item) - { - TreeViewItem parent; - while ((parent = GetParent(item)) != null) - { - return GetDepth(parent) + 1; - } - return 0; - } - - private static TreeViewItem GetParent(TreeViewItem item) - { - var parent = VisualTreeHelper.GetParent(item); - - while (!(parent is TreeViewItem || parent is TreeView)) - { - if (parent == null) return null; - parent = VisualTreeHelper.GetParent(parent); - } - return parent as TreeViewItem; - } - } -} diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/packages.config b/LaDOSE.Src/LaDOSE.DesktopApp/packages.config deleted file mode 100644 index 4864854..0000000 --- a/LaDOSE.Src/LaDOSE.DesktopApp/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.REST/RestService.cs b/LaDOSE.Src/LaDOSE.REST/RestService.cs index e801c50..034406d 100644 --- a/LaDOSE.Src/LaDOSE.REST/RestService.cs +++ b/LaDOSE.Src/LaDOSE.REST/RestService.cs @@ -24,7 +24,10 @@ namespace LaDOSE.REST public event EventHandler UpdatedJwtEvent; - public RestService() { } + public RestService() + { + + } public void Connect(Uri url, string user, string password) @@ -36,7 +39,7 @@ namespace LaDOSE.REST #if DEBUG options.MaxTimeout = Int32.MaxValue; #endif - options.Authenticator = new JwtAuthenticator("token"); + options.Authenticator = new JwtAuthenticator(token); }); this.username = user; diff --git a/LaDOSE.Src/LaDOSE.linux.sln b/LaDOSE.Src/LaDOSE.linux.sln index 96c4984..f581ec2 100644 --- a/LaDOSE.Src/LaDOSE.linux.sln +++ b/LaDOSE.Src/LaDOSE.linux.sln @@ -23,6 +23,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LaDOSE.REST", "LaDOSE.REST\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LinuxTest", "LinuxTest\LinuxTest.csproj", "{0EFA533F-9657-40CE-A3A5-F4E3C6E649B1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaDOSE.DesktopApp.Avalonia", "LaDOSE.DesktopApp.Avalonia\LaDOSE.DesktopApp.Avalonia.csproj", "{1A3C654A-2730-42DA-B714-187169965A31}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -57,6 +59,10 @@ Global {0EFA533F-9657-40CE-A3A5-F4E3C6E649B1}.Debug|Any CPU.Build.0 = Debug|Any CPU {0EFA533F-9657-40CE-A3A5-F4E3C6E649B1}.Release|Any CPU.ActiveCfg = Release|Any CPU {0EFA533F-9657-40CE-A3A5-F4E3C6E649B1}.Release|Any CPU.Build.0 = Release|Any CPU + {1A3C654A-2730-42DA-B714-187169965A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A3C654A-2730-42DA-B714-187169965A31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A3C654A-2730-42DA-B714-187169965A31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A3C654A-2730-42DA-B714-187169965A31}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE