public DnsIPEndpointSettings AsDnsIPEndpointSettings() { DnsIPEndpointSettings settings = new DnsIPEndpointSettings(); settings.Address = this.Address; settings.Port = this.Port; return settings; }
public DnsIPEndpointSettings AsDnsIPEndpointSettings() { DnsIPEndpointSettings settings = new DnsIPEndpointSettings(); settings.Address = this.Address; settings.Port = this.Port; return(settings); }
public AuthoritativeResolutionSettings AsAuthoritativeResolutionSettings() { AuthoritativeResolutionSettings settings = new AuthoritativeResolutionSettings(); settings.Cache = this.Cache; settings.TimeoutMilliseconds = this.TimeoutMilliseconds; settings.DnsResolutionPort = this.DnsResolutionPort; DnsIPEndpointSettings[] endpoints = new DnsIPEndpointSettings[this.PrimaryNameServers.Count]; int i = 0; foreach (DnsIPEndpointElement element in this.PrimaryNameServers) { endpoints[i] = element.AsDnsIPEndpointSettings(); i++; } settings.PrimaryNameServer = endpoints; return settings; }
public AuthoritativeResolutionSettings AsAuthoritativeResolutionSettings() { AuthoritativeResolutionSettings settings = new AuthoritativeResolutionSettings(); settings.Cache = this.Cache; settings.TimeoutMilliseconds = this.TimeoutMilliseconds; settings.DnsResolutionPort = this.DnsResolutionPort; DnsIPEndpointSettings[] endpoints = new DnsIPEndpointSettings[this.PrimaryNameServers.Count]; int i = 0; foreach (DnsIPEndpointElement element in this.PrimaryNameServers) { endpoints[i] = element.AsDnsIPEndpointSettings(); i++; } settings.PrimaryNameServer = endpoints; return(settings); }
private void ParsePrimaryNameServers(DnsIPEndpointSettings[] primaryDnsServers) { if (primaryDnsServers == null) { throw new ArgumentNullException("primaryDnsServers"); } if (primaryDnsServers.Length < 1) { throw new ArgumentException("NoPrimaryDns"); } foreach (DnsIPEndpointSettings endpoint in primaryDnsServers) { if (m_primaryDnsServers == null) { m_primaryDnsServers = new List<IPEndPoint>(primaryDnsServers.Length); } m_primaryDnsServers.Add(new IPEndPoint(IPAddress.Parse(endpoint.Address), endpoint.Port)); } }