Přidání nového projektu - pokus o explorer
This commit is contained in:
1 parent
b0b0b3ee34
commit
d06a9f332b
48 files changed
+1429
No files matched your search
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using winui_learning_2.Helpers;
|
||||
using Windows.UI;
|
||||
|
||||
namespace winui_learning_2.Models;
|
||||
|
||||
public class ActivityDisplayItem
|
||||
{
|
||||
public string Username { get; init; } = string.Empty;
|
||||
public string Action { get; init; } = string.Empty;
|
||||
public string CategoryLabel { get; init; } = string.Empty;
|
||||
public Color CategoryColor { get; init; }
|
||||
public string TimestampText { get; init; } = string.Empty;
|
||||
|
||||
public static ActivityDisplayItem From(DashboardActivity activity) => new()
|
||||
{
|
||||
Username = activity.Username,
|
||||
Action = activity.Action,
|
||||
CategoryLabel = DashboardFormatting.CategoryLabel(activity.Category),
|
||||
CategoryColor = GetCategoryColor(activity.Category),
|
||||
TimestampText = DashboardFormatting.FormatDateTime(activity.Timestamp)
|
||||
};
|
||||
|
||||
private static Color GetCategoryColor(string category) => category switch
|
||||
{
|
||||
"win" => Color.FromArgb(255, 25, 135, 84),
|
||||
"loss" => Color.FromArgb(255, 220, 53, 69),
|
||||
"bet" => Color.FromArgb(255, 255, 193, 7),
|
||||
"payment" => Color.FromArgb(255, 13, 202, 240),
|
||||
"team" => Color.FromArgb(255, 108, 117, 125),
|
||||
_ => Color.FromArgb(255, 33, 37, 41)
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user