using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PTMedicalInsurance.Helper
{
    class InvokeCenterFactory
    {
        private static IInvokeCenter __invoker = null;

        /// <summary>
        /// 创建调用模式
        /// </summary>
        /// <returns></returns>
        public static IInvokeCenter create(ModeEnum mode)
        {
            if (__invoker != null) return __invoker;

            switch (mode)
            {
                case ModeEnum.DLL:
                    __invoker = new InvokeDllCenter();
                    break;
                case ModeEnum.COM:
                    __invoker = new InvokeOcxCenter();
                    break;
                case ModeEnum.REST:
                default:
                    __invoker = new InvokeRestCenter();
                    break;
            }
            return __invoker;
            
        }


    }
}
