// <auto-generated />
using System;
namespace TestApp
{
    /// <summary>
    /// 为 <see cref="TestApp.Status" /> 提供自动生成的扩展方法。
    /// </summary>
    public static partial class StatusExtensions
    {
        /// <summary>
        /// 判断给定值是否为 <see cref="TestApp.Status.Active" />。
        /// </summary>
        /// <param name="value">要检查的枚举值。</param>
        /// <returns>当 <paramref name="value" /> 等于 <see cref="TestApp.Status.Active" /> 时返回 <see langword="true" />；否则返回 <see langword="false" />。</returns>
        public static bool IsActive(this TestApp.Status value) => value == TestApp.Status.Active;

        /// <summary>
        /// 判断给定值是否为 <see cref="TestApp.Status.Inactive" />。
        /// </summary>
        /// <param name="value">要检查的枚举值。</param>
        /// <returns>当 <paramref name="value" /> 等于 <see cref="TestApp.Status.Inactive" /> 时返回 <see langword="true" />；否则返回 <see langword="false" />。</returns>
        public static bool IsInactive(this TestApp.Status value) => value == TestApp.Status.Inactive;

        /// <summary>
        /// 判断给定值是否属于指定候选集合。
        /// </summary>
        /// <param name="value">要检查的枚举值。</param>
        /// <param name="values">用于匹配的候选枚举值集合；当为 <see langword="null" /> 时返回 <see langword="false" />。</param>
        /// <returns>当 <paramref name="value" /> 命中任一候选值时返回 <see langword="true" />；否则返回 <see langword="false" />。</returns>
        public static bool IsIn(this TestApp.Status value, params TestApp.Status[] values)
        {
            if (values == null) return false;
            foreach (var v in values) if (value == v) return true;
            return false;
        }
    }
}
