/// <summary> /// 从配置文件中得到服务器配置信息 /// </summary> /// <returns></returns> public static IdentityConfigSettings GetConfig() { IdentityConfigSettings result = (IdentityConfigSettings)ConfigurationBroker.GetSection("identityConfigSettings"); if (result == null) result = new IdentityConfigSettings(); return result; }
/// <summary> /// 从配置文件中得到服务器配置信息 /// </summary> /// <returns></returns> public static IdentityConfigSettings GetConfig() { IdentityConfigSettings result = (IdentityConfigSettings)ConfigurationBroker.GetSection("identityConfigSettings"); if (result == null) { result = new IdentityConfigSettings(); } return(result); }
/// <summary> /// 转换为ServerInfo对象 /// </summary> /// <returns></returns> public ServerInfo ToServerInfo() { ServerInfo info = new ServerInfo(); info.ServerName = this.ServerName; info.AuthenticateType = this.AuthenticateType; info.Port = this.Port; if (string.IsNullOrEmpty(this.IdentityName) == false) { IdentityConfigurationElement idElem = IdentityConfigSettings.GetConfig().Identities[this.IdentityName]; ExceptionHelper.FalseThrow(idElem != null, "不能在identityConfigSettings配置节中找到ServerInfo的配置项{0}中配置的Identity: {1}", this.Name, this.IdentityName); info.Identity = idElem.ToLogOnIdentity(); } return(info); }