/// <summary> /// 初始化第三方帐号获取器 /// </summary> public static void InitializeAll() { if (!isInitialized) { lock (lockObject) { if (!isInitialized) { thirdAccountGetters = new ConcurrentDictionary <string, ThirdAccountGetter>(); foreach (var accountType in new AccountBindingService().GetAccountTypes()) { Type thirdAccountGetterClassType = Type.GetType(accountType.ThirdAccountGetterClassType); if (thirdAccountGetterClassType != null) { ConstructorInvoker thirdAccountGetterConstructor = thirdAccountGetterClassType.DelegateForCreateInstance(); ThirdAccountGetter thirdAccountGetter = thirdAccountGetterConstructor() as ThirdAccountGetter; if (thirdAccountGetter != null) { thirdAccountGetters[accountType.AccountTypeKey] = thirdAccountGetter; } } } isInitialized = true; } } } }
/// <summary> /// 帐号类型名称 /// </summary> public static string AccountTypeName(this AccountType accountType) { ThirdAccountGetter thirdAccountGetter = ThirdAccountGetterFactory.GetThirdAccountGetter(accountType.AccountTypeKey); if (thirdAccountGetter == null) { return(string.Empty); } return(thirdAccountGetter.AccountTypeName); }