mirror of
https://github.com/hmaxnl/SharpRSS.git
synced 2024-11-09 23:44:20 +01:00
34 lines
915 B
C#
34 lines
915 B
C#
using System;
|
|
|
|
namespace SharpRss.Models
|
|
{
|
|
/// <summary>
|
|
/// To store and load data from file/database
|
|
/// </summary>
|
|
public class CategoryModel
|
|
{
|
|
public CategoryModel()
|
|
{
|
|
HexColor = $"#{_random.Next(0x1000000):X6}";
|
|
CategoryId = Guid.NewGuid().ToString();
|
|
}
|
|
private readonly Random _random = new Random();
|
|
|
|
public static CategoryModel Create(string categoryName, string hexColor, string id)
|
|
{
|
|
CategoryModel catModel = new CategoryModel()
|
|
{
|
|
Name = categoryName,
|
|
HexColor = hexColor,
|
|
CategoryId = id
|
|
};
|
|
return catModel;
|
|
}
|
|
|
|
public string Name { get; set; }
|
|
public string HexColor { get; set; }
|
|
public string PathIcon { get; set; }
|
|
public string CategoryId { get; private set; }
|
|
}
|
|
}
|