using CloudBuilder.Core.DependencyInjection.Form;
using CloudBuilder.Core.DependencyInjection.Policy;
using CloudBuilder.Core.DependencyInjection.Request;
using CloudBuilder.Core.Policy;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.VisualStudio.OLE.Interop;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;

namespace CloudBuilder.Security.Policy
{

    public class CulturePolicy : AbstractPolicy, IPolicy
    {
        public const string ZH_CN = "zh-cn";
        public const string EN = "en";

        public static CulturePolicy instance = null;

        public CulturePolicy(IContext context) : base(context)
        {
            this.values = new string[] { ZH_CN, EN };
        }

        public static CulturePolicy GetInstance()
        {
            instance = ApplicationServiceContext.ServiceProvider.GetKeyedService<CulturePolicy>(typeof(CulturePolicy).Name);
            return instance;
        }

        //public class CulturePolicy : LocalePolicy, IPolicy
        //public CulturePolicy(IContext context, ILocaleMessageManager localeMessageManager) : base(context, localeMessageManager)
        //{
        //    this.context = context;
        //    this.localeMessageManager = localeMessageManager;

        //    this.values = new string[] { ZH_CN, EN };
        //    this.Name = typeof(CulturePolicy).Name;
        //}


        public static bool IsZhcn(string value)
        {
            return value == ZH_CN;
        }
    }
}
