Commit Debut de rework

This commit is contained in:
2022-03-19 22:54:55 +01:00
parent aebc60d17f
commit ab02d292da
24 changed files with 234 additions and 212 deletions

View File

@@ -19,14 +19,15 @@ namespace LaDOSE.DesktopApp
{
#if DEBUG
MessageBox.Show("WAITING IN DEBUG MODE");
MessageBox.Show("WAITING IN DEBUG MODE");
#endif
base.OnStartup(e);
var settings = new CefSettings();
settings.SetOffScreenRenderingBestPerformanceArgs();
Cef.Initialize(settings);
base.OnStartup(e);
}

View File

@@ -26,7 +26,6 @@ namespace LaDOSE.DesktopApp
container.Singleton<IWindowManager, WindowManager>();
container.Singleton<RestService>();
container.PerRequest<ShellViewModel>();

View File

@@ -31,7 +31,7 @@ namespace LaDOSE.DesktopApp.ViewModels
this.AppIcon = BitmapFrame.Create(Application.GetResourceStream(new Uri("/LaDOSE.DesktopApp;component/Resources/64x64.png",
UriKind.RelativeOrAbsolute)).Stream);
var appSettings = ConfigurationManager.AppSettings;
string url = (string)appSettings["ApiUri"];
string user = (string)appSettings["ApiUser"];
@@ -41,9 +41,10 @@ namespace LaDOSE.DesktopApp.ViewModels
restService.UpdatedJwtEvent += TokenUpdate;
restService.Connect(uri, user, password);
base.OnInitialize();
ActivateItem(new TournamentResultViewModel(IoC.Get<RestService>()));
}
private void TokenUpdate(object sender, UpdatedJwtEventHandler e)
@@ -56,7 +57,7 @@ namespace LaDOSE.DesktopApp.ViewModels
public void LoadEvent()
{
ActivateItem(new WordPressViewModel(IoC.Get<RestService>()));
ActivateItem(new WordPressViewModel(IoC.Get<RestService>()));
}
public void LoadGames()
{

View File

@@ -344,7 +344,13 @@ namespace LaDOSE.DesktopApp.ViewModels
int columns = 0;
foreach (var game in Results.Games)
{
List<ResultDTO> enumerable = Results.Results.Where(r => r.GameId == game.Id).ToList();
List<string> top3 = enumerable.OrderBy(e => e.Rank).Take(3).Select(e => e.Player).ToList();
if (top3.Count == 0)
{
continue;
}
if (columns % 2 == 0)
{
sb.Append("<tr>");
@@ -354,8 +360,7 @@ namespace LaDOSE.DesktopApp.ViewModels
"<span style=\"color: #ff0000;\">" +
$"<strong>{game.LongName} ({Results.Results.Count(e => e.GameId == game.Id)} participants) :</strong>" +
"</span>");
List<ResultDTO> enumerable = Results.Results.Where(r => r.GameId == game.Id).ToList();
List<string> top3 = enumerable.OrderBy(e => e.Rank).Take(3).Select(e => e.Player).ToList();
if (top3.Count >= 3)
{
sb.AppendLine($"<br> 1/ {top3[0]}<br> 2/ {top3[1]}<br> 3/ {top3[2]} <br>");