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

namespace PTMedicalInsurance.Helper
{
    class InvokeCenterFactory
    {
        /// <summary>
        /// 创建调用模式
        /// </summary>
        /// <returns></returns>
        public IInvokeCenter create(ModeEnum mode)
        {
            // 不能用静态，否则com调用会异常
            IInvokeCenter __invoker = null;
            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;
            
        }


    }
}
