Files
LanMountainDesktop/LanMountainDesktop/Models/IfengNewsChannelTypes.cs
lincube 1f509959a9 0.4.8
百度热搜组件、凤凰新闻组件。
2026-03-06 22:24:59 +08:00

33 lines
791 B
C#

using System;
using System.Collections.Generic;
namespace LanMountainDesktop.Models;
public static class IfengNewsChannelTypes
{
public const string Comprehensive = "Comprehensive";
public const string Mainland = "Mainland";
public const string Taiwan = "Taiwan";
public static IReadOnlyList<string> SupportedValues { get; } =
[
Comprehensive,
Mainland,
Taiwan
];
public static string Normalize(string? value)
{
var candidate = value?.Trim() ?? string.Empty;
foreach (var supported in SupportedValues)
{
if (string.Equals(candidate, supported, StringComparison.OrdinalIgnoreCase))
{
return supported;
}
}
return Comprehensive;
}
}