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; private static string mode = ""; // dll,ocx,rest /// /// 通过配置加载调用模式(默认为rest) /// private static void init() { mode = "dll"; } /// /// 创建调用模式 /// /// public static IInvokeCenter create() { if (string.IsNullOrEmpty(mode)) { init(); } if (__invoker != null) return __invoker; switch (mode) { case "dll": __invoker = new InvokeDllCenter(); break; case "ocx": __invoker = new InvokeDllCenter(); break; case "rest": default: __invoker = new InvokeRestCenter(); break; } return __invoker; } } }