2024-10-19 21:14:38 +02:00
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
2025-03-03 00:56:32 +01:00
|
|
|
namespace WatchIt.Website.Components.Subcomponents.Common;
|
2024-10-19 21:14:38 +02:00
|
|
|
|
2025-03-03 00:56:32 +01:00
|
|
|
public partial class Loading : Component
|
2024-10-19 21:14:38 +02:00
|
|
|
{
|
|
|
|
|
#region PARAMETERS
|
|
|
|
|
|
2025-03-03 00:56:32 +01:00
|
|
|
[Parameter] public Colors Color { get; set; } = Colors.Dark;
|
2024-10-19 21:14:38 +02:00
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region PRIVATE METHODS
|
|
|
|
|
|
|
|
|
|
private string GetColor()
|
|
|
|
|
{
|
|
|
|
|
DescriptionAttribute? attribute = Color.GetType()
|
|
|
|
|
.GetTypeInfo()
|
|
|
|
|
.GetMember(Color.ToString())
|
|
|
|
|
.FirstOrDefault(member => member.MemberType == MemberTypes.Field)!
|
|
|
|
|
.GetCustomAttributes(typeof(DescriptionAttribute), false)
|
|
|
|
|
.SingleOrDefault()
|
|
|
|
|
as DescriptionAttribute;
|
|
|
|
|
return attribute!.Description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region ENUMS
|
|
|
|
|
|
2025-03-03 00:56:32 +01:00
|
|
|
public enum Colors
|
2024-10-19 21:14:38 +02:00
|
|
|
{
|
|
|
|
|
[Description("dark")]
|
|
|
|
|
Dark,
|
|
|
|
|
|
|
|
|
|
[Description("light")]
|
|
|
|
|
Light,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|